
This has occurred since the beginning of JavaScript and is generally regarded as a mistake in the original JavaScript implementation. Interestingly enough, when using typeof to test null, it returns object: let a = null let b console.log(typeof a) // object console.log(typeof b) // undefined Here is a full list:Īll other values in JavaScript are objects (objects, functions, arrays, etc.). Both null and undefined are primitive values. Triple EqualsĪlso in JavaScript, there are six primitive values. If you’re not familiar with truthy/falsy values in JavaScript, I recommend reading my previous article: JavaScript - Double Equals vs. Here’s a full list:Īny other value in JavaScript is considered truthy.

Both null and undefined are two of the six falsy values. In JavaScript there are only six falsy values.
