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

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
主站蜘蛛池模板: 青浦区| 榕江县| 铅山县| 廊坊市| 华容县| 湟中县| 绥江县| 盘锦市| 运城市| 元谋县| 罗源县| 盐津县| 绥江县| 田东县| 松潘县| 永新县| 昌吉市| 芒康县| 抚州市| 临夏市| 彭山县| 喀喇| 齐齐哈尔市| 镇平县| 兰西县| 乌兰浩特市| 凌云县| 灌南县| 苍山县| 师宗县| 呼图壁县| 桑日县| 含山县| 旬邑县| 凉山| 台安县| 桂平市| 临泽县| 青海省| 北海市| 潞西市|