Do you know what will be the output of this code?
JavaScript
console.log(null == undefined, null === undefined);
Show answer and explanation
The answer is true false.
The spec defines null == undefined as true, and neither is loosely equal to anything else. They are still different types, so === returns false.
That makes value == null a handy check for “null or undefined”.