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

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.

主站蜘蛛池模板: 望城县| 渝北区| 宁南县| 抚顺县| 平湖市| 南京市| 青阳县| 封丘县| 武陟县| 朝阳区| 贵德县| 泸水县| 白玉县| 旌德县| 澄江县| 德兴市| 张北县| 江永县| 章丘市| 扎兰屯市| 乌苏市| 颍上县| 西藏| 佛冈县| 五原县| 沈丘县| 陵水| 石首市| 隆德县| 寻乌县| 慈利县| 梧州市| 息烽县| 酒泉市| 开鲁县| 汤原县| 博兴县| 连州市| 秭归县| 临江市| 吴江市|