Skip to content

Latest commit

 

History

History
6 lines (3 loc) · 433 Bytes

Null vs Undefined.md

File metadata and controls

6 lines (3 loc) · 433 Bytes

In [[JavaScript]], all uninstantiated variables default to undefined. Undefined is actually a special value in JavaScript which means that a variable has not been set.

Null is generally considered to be intentional while undefined is considered to be unintentional.

The implication of this is that when a variable can be a value or a non-value it is common practice for the type non value or type to be null rather than undefined.