string
let name = 'Mike'
int
let age = 29
float
let height = 189.3
array
let data: int[] = [1, 2, 3]
You don't need to declare variable type for basic types like numbers and strings - they are inferred automatically. Type declaration is necessary in complex data structures like Arrays, Sets etc.
Arrays
Sets
Last updated 5 years ago
Was this helpful?