标签:场景 def null 应对 efault 使用 使用场景 int 区分
null和undefined是两种数据类型, 如果硬要区分的话。
null是一种类型, 赋值变量为null型。
未定义的变量, 即为undefined。
var a = null
a // null
var b
b // undefined
typeof(b) // "undefined"
标准解释
6.1.1 The Undefined Type
The Undefined type has exactly one value, called undefined. Any variable that has not been assigned a value has the value undefined.
6.1.2 The Null Type
The Null type has exactly one value, called null.
undefined使用场景:
标签:场景 def null 应对 efault 使用 使用场景 int 区分
原文地址:https://www.cnblogs.com/daaasheng/p/9962668.html