- Learning Ionic(Second Edition)
- Arvind Ravulavaru
- 50字
- 2021-07-02 23:24:24
Defining types
When we declare variables, we can optionally declare the types of variables. For instance:
name: string = 'Arvind';
age: number = 99;
isAlive: boolean = true;
hobbies: string[];
anyType: any;
noType = 50;
noType = 'Random String';
This increases the predictability of what we are trying to do.