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

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
主站蜘蛛池模板: 海安县| 郑州市| 济南市| 樟树市| 柳州市| 甘孜| 迁安市| 沙河市| 绥芬河市| 阜阳市| 浙江省| 右玉县| 亚东县| 绥棱县| 巴里| 凤山市| 梁平县| 望江县| 策勒县| 新野县| 辽阳市| 治多县| 乐清市| 墨江| 潞西市| 修武县| 绿春县| 庆安县| 云霄县| 西华县| 曲阳县| 六枝特区| 南京市| 上思县| 故城县| 望城县| 博野县| 涞源县| 东光县| 尚义县| 广灵县|