DRAFT
NullAndUndefinedAreTheSame
Misconception:
It is possible to use the value null
and undefined
interchangeably in any situation.
Incorrect
The values null and undefined are the same
Correct
null and undefined are two distinct values
CorrectionHere is what's right.
Here is what's right.
In JavaScript null
and undefined
represent the nullish values. Their values are equal, but do not share the same type.
null === undefined // false
null == undefined // true
In JavaScript null
represents the intentional absence of any object value.
In JavaScript undefined
represents when a variable has not been assigned a value.