JavaScript · Junior · Question 9 of 75
How does null differ from undefined?
- ✓Correct answer:
undefinedmeans no value was assigned,nullis an explicit "empty" set by the programmer - 2
nullmeans no value was assigned, whileundefinedis an explicitly set "empty" - 3They are the same value;
null === undefinedreturnstrue
Explanation
undefined is what uninitialized variables, missing properties and parameters, and functions without return produce. null is assigned on purpose. null == undefined is true, but null === undefined is false.