官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 集安市| 东台市| 微博| 灌云县| 吴旗县| 淄博市| 开鲁县| 保靖县| 沧州市| 中江县| 双辽市| 理塘县| 南和县| 望城县| 柏乡县| 建瓯市| 长乐市| 勐海县| 墨脱县| 辛集市| 东丽区| 深州市| 康平县| 建德市| 大埔县| 甘德县| 靖州| 昆山市| 万全县| 石首市| 邓州市| 岳普湖县| 温泉县| 贡觉县| 江油市| 龙岩市| 唐山市| 天等县| 岳西县| 集安市| 蓬溪县|