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

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
主站蜘蛛池模板: 华坪县| 临西县| 郓城县| 河北省| 黔西县| 罗甸县| 虹口区| 准格尔旗| 同江市| 出国| 邵阳县| 泊头市| 灵宝市| 昂仁县| 宁城县| 樟树市| 息烽县| 黎城县| 晋江市| 新安县| 昭觉县| 敖汉旗| 四平市| 曲麻莱县| 广昌县| 娄底市| 利川市| 茶陵县| 博兴县| 全椒县| 武乡县| 抚宁县| 浪卡子县| 青铜峡市| 台湾省| 泉州市| 九龙城区| 赫章县| 从化市| 揭东县| 太和县|