🚀 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
JavaScript Quirk: typeof null Returns 'object'
More Relevant Posts
-
💡 JavaScript Call Stack 🧠 What is the Call Stack? It keeps track of which function is currently running in JavaScript. ⚡ Why do we need it? JavaScript executes code one function at a time Call Stack maintains execution order 🧠 Think Like This Function called → pushed to stack Function finished → popped from stack 🎯 Interview One-Liner Call Stack manages function execution order. 📌 Used In Function calls Recursion Error stack traces #JavaScript #CallStack #ExecutionContext #FrontendDevelopment #InterviewTips
To view or add a comment, sign in
-
🧠 Understanding JavaScript Event Loop – the heart of async JS This visual explains how JavaScript handles asynchronous operations using: ✔ Call Stack ✔ Web APIs ✔ Callback Queue ✔ Event Loop Even though JavaScript is single-threaded, it never blocks — thanks to the event loop ⚡ This concept is 🔑 for cracking JavaScript & React interviews. If you truly understand this, async code stops being scary 😌 #JavaScript #EventLoop #AsyncJavaScript #FrontendDevelopment #WebDevelopment #ReactJS #InterviewPreparation #LearningInPublic
To view or add a comment, sign in
-
-
JavaScript Array Methods Every Developer Must Know Writing clean, readable, and efficient JavaScript becomes much easier when you truly understand array methods. This guide covers essential JavaScript array methods like: 👉 map() 👉 filter() 👉 reduce() 👉 forEach() 👉 find() 👉 some() & every() 👉 sort() …and many more, with real-world use cases and interview-focused explanations. Perfect for: •Frontend Developers •JavaScript Interview Preparation •Daily Revision & Skill Polishing •Beginners to Intermediate Developers If you work with JavaScript daily, this is a must-save resource. 📥 Download and keep it handy for quick reference. #JavaScript #ArrayMethods #JSBasics #FrontendDevelopment
To view or add a comment, sign in
-
🔄 Async/Await in JavaScript — Simple Explanation async/await is a modern way to handle asynchronous code in JavaScript. It makes code that works with Promises look clean and easy to read — like 👉 Key Points 🔹 async makes a function return a Promise 🔹 await pauses execution until the Promise resolves 🔹 Use try...catch for error handling 🎯 Why It Matters 🔹 Cleaner code 🔹 Better readability 🔹 Easier debugging Modern JavaScript development is incomplete without understanding async/await. #JavaScript #WebDevelopment #AsyncProgramming
To view or add a comment, sign in
-
-
💡 JavaScript Tip of the day What will be the output? console.log(typeof null); 👉 Answer: "object" Yes, it’s a well-known JavaScript bug 😉 #JavaScript #DeveloperLife #FrontendDeveloper #CodingQuestions #Developers
To view or add a comment, sign in
-
Day 31/100 🚀 Understanding JavaScript errors — syntax, reference, and type errors, how to read error messages, and better ways to debug and resolve issues. #100DaysOfCode #JavaScript #WebDev
To view or add a comment, sign in
-
🚀 Difference Between Synchronous & Asynchronous JavaScript (Explained Simply) Ever wondered why JavaScript sometimes waits… and sometimes doesn’t? In this short video, I explain the difference between Synchronous and Asynchronous JavaScript using a real-life restaurant example 🍽️ — no complex theory, just simple logic. 👉 Synchronous JavaScript “One task at a time. Wait until it finishes.” 👉 Asynchronous JavaScript “Multiple tasks together. No waiting.” If you’re a beginner in JavaScript or preparing for frontend / backend interviews, this concept is a must-know. 📌 Save this for revision 📌 Share with someone learning JavaScript #JavaScript #WebDevelopment #FrontendDevelopment #ProgrammingBasics #LearnJavaScript #Developers #CodingJourney #AsyncJS
To view or add a comment, sign in
-
💡 JavaScript Event Loop 🧠 What is the Event Loop? It decides when synchronous and asynchronous code runs in JavaScript. ⚡ Why do we need it? JavaScript is single-threaded Event Loop handles async tasks without blocking the UI 🧠 Think Like This Call Stack → Task Queue → Microtask Queue → Event Loop 🎯 Interview One-Liner Event Loop keeps JavaScript non-blocking. 📌 Used In setTimeout Promises Async / Await #JavaScript #EventLoop #AsyncProgramming #FrontendDevelopment #InterviewTips
To view or add a comment, sign in
-
🔥 JavaScript Output-Based Question What will be the output of the above code? 👉 Comment your answer below (Don’t run the code ❌) Output: 1 2 1 3 🧠 Why this output comes? (Step-by-Step Explanation) This example is all about JavaScript closures. 1️⃣ Each function call creates a new closure Counter1 and Counter2 are created by separate executions. Each execution creates its own count variable in memory. Internally: Counter1 → count = 0 Counter2 → count = 0 (completely independent) 2️⃣ Execution flow First call of Counter1 → count becomes 1 → prints 1 Second call of Counter1 → count becomes 2 → prints 2 First call of Counter2 → separate closure → count becomes 1 → prints 1 Third call of Counter1 → back to first closure → count becomes 3 → prints 3 #JavaScript #Closures #FrontendDeveloper #MERNStack #ReactJS #InterviewQuestions
To view or add a comment, sign in
-
-
The weirdest value in JavaScript — explained fast. 😈 This is the edited version. NaN is not a number… And it’s not equal to itself either. A quick JS concept every developer must know. #CodeBreakDev #JavaScript #NaN #JSConcepts #InterviewPrep
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development