The data type
Data types can be defined explicitly or implicitly by context
1. Explicit definition
let myNumber1: number = 1 // Define the number type
let myNumber2: number // Define the number type
// 2. Implicit definition of context
let myString = 'zhao' // Defined as string
Copy the code
- number,boolean,string,array,