JavaScript Quirk: typeof null Returns 'object'

🚀 TIL in JavaScript typeof null returns "object" 🤯 Yes, this is real — and it’s one of the oldest JavaScript quirks. 🧠 null means no value, but JavaScript still treats it as an "object" due to a historical bug. Example: ✔ typeof 10 → "number" ✔ typeof "JS" → "string" ✔ typeof null → "object" ❌ 📌 Always check null explicitly in real-world code and interviews. #JavaScript #WebDevelopment #FrontendDeveloper #CodingTips #TodayILearned

  • graphical user interface, text, application

To view or add a comment, sign in

Explore content categories