JavaScriptBeginner#fundamentals

Difference between null and undefined?

undefined means a variable was declared but never assigned, or a missing property/return. null is an explicit assignment meaning 'no value'. typeof null is 'object' while typeof undefined is 'undefined'.

Example
let a;            // undefined
let b = null;     // intentional empty
a == b;  // true
a === b; // false

Related Questions

1
JavaScriptIntermediate#es6#collections

Difference between Map/Set and plain objects/arrays?

Open
2
JavaScriptIntermediate#objects

What is the difference between shallow copy and deep copy?

Open
3
JavaScriptBeginner#es6#strings

What are template literals?

Open