Why (typeof null) returns an object in JavaScript?
Aug 4, 2025 · 2 min read · Lets discuss and understand this well known bug in JavaScript that was kept intentionally due to compatibility and existing flow of the code.null is a primitive value in JavaScript. console.log(typeof "MyName"); // string console.log(typeof true); ...
MPMayank and 1 more commented
