distinguish between null and undefined:

Omar Faruq
May 5, 2021

--

A null is an object and Undefined is a type itself.

Null indicates the absence of a value for a variable. and Undefined indicates the absence of the variable itself.

Null is converted to zero (0) while performing primitive operations. and Undefined is converted to NaN while performing primitive operations.

null is an empty or non-existent value. and undefined is a non-existent variable.

--

--