Do you know what will be the output of this code?
JavaScript
console.log(typeof null);
Show answer and explanation
The answer is "object".
This is a bug from the very first JavaScript engine, where values were tagged by type and null shared the tag used for objects. Fixing it would break existing websites, so it stays.
To check for null, compare directly: value === null.