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

Types: undefined and null

In TypeScript, undefined and null are types themselves; this means that undefined is a type (undefined) and null is a type (null). Confusing? undefined and null cannot be  type  variables; they can only be assigned as values to variables.

They are also different: a null variable means that a variable was set to null, while an undefined variable has no value assigned.

let A = null;
console.log(A) // null
console.log(B) // undefined
主站蜘蛛池模板: 元阳县| 阳江市| 行唐县| 长子县| 遂宁市| 利津县| 土默特右旗| 赣州市| 阿巴嘎旗| 内江市| 鹤峰县| 大兴区| 九龙坡区| 西峡县| 泾川县| 宁化县| 嘉义县| 东兰县| 清水河县| 井冈山市| 新干县| 安宁市| 天祝| 行唐县| 虞城县| 马鞍山市| 鲁甸县| 桂林市| 昂仁县| 文安县| 杂多县| 疏附县| 正安县| 巨野县| 岳阳县| 民权县| 交口县| 景泰县| 朝阳市| 辉县市| 鸡东县|