π€ Ever wondered why typeof null returns "object" in JavaScript?
This behavior has been around since the early days of JS, and it's actually due to how JavaScript was originally implemented. Back then, values were stored in 32-bit units, with a few bits representing the type. Since null was represented as 0 (like objects), it ended up being categorized as an "object."
Despite null being a primitive type, this "bug" still exists today.
#JavaScriptTrivia #WebDevelopment