May 2001
Intermediate to advanced
720 pages
23h 24m
English
Intellectually, the null type is
nearly identical to the undefined type. Like the
undefined datatype, the
null datatype is used to represent a lack of
data and has only one legal value, the primitive value
null. The null value is not
assigned by the interpreter automatically, but rather by us
deliberately.
We assign null to a variable, array element, or
object property to indicate that the specified data container does
not contain a legal number, string, boolean, array, or object value.
Note that null only compares equal to itself and
undefined:
null == undefined; // true null == null; // true
Read now
Unlock full access