Javascript null Type

Introduction

Java null type has only one value: null.

A null value is an empty object pointer.

'typeof null' returns "object":

let car = null; 
console.log(typeof car);   // "object" 

When defining a variable that will hold an object, we should initialize the variable to null.

The value undefined is a derivative of null:

console.log(null == undefined);   // true 

Using the equality operator (==) between null and undefined always returns true.




PreviousNext

Related