🤔 Quick JavaScript question What do you think this logs? console.log(typeof null); console.log(typeof undefined); 👉 Output "object" "undefined" Surprising, right? 😄 🔹 null is meant to represent an intentional absence of value, but due to a legacy JavaScript bug, typeof null returns "object". 🔹 undefined means a variable exists but has not been assigned a value, and typeof undefined correctly reflects that. #JavaScript #WebDevelopment #NodeJS #MERN #LearningInPublic
JavaScript typeof null and undefined behavior
More Relevant Posts
-
Quick JS Brain Teaser: Strings are immutable in JavaScript, but what does that really mean in practice? Take a look at this image: What will be the output? A) "KavaScript" B) "JavaScript" C) undefined D) TypeError Does this match your expectation? Drop your answer in the comments and explain WHY! Understanding string immutability is crucial for avoiding common bugs in JavaScript. #JavaScript #JavaScriptInterviewQuestion #JavaScriptFundamentals
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
-
JavaScript: “𝗧𝗿𝘂𝘀𝘁 𝗺𝗲 𝗯𝗿𝗼.” typeof null === "object" [] == false NaN !== NaN None of these throw errors. None of them are getting fixed. It’s not broken. It’s consistent. Consistently confusing. And somehow, we still build everything on top of it. #JavaScript #WebDevelopment #DeveloperLife #TechHumor
To view or add a comment, sign in
-
-
Today I implemented a HashMap in JavaScript - not because I need to (JavaScript already has Map!), but because understanding the fundamentals makes you a better developer. Key takeaways: → How hashing functions work → Managing collisions efficiently → The trade-offs between time and space complexity What fundamental concept have you explored lately? #SoftwareEngineering #JavaScript #ContinuousLearning
To view or add a comment, sign in
-
-
🟢 Day 17 / 100 – 📌JavaScript Practice 🚀 ✅ Practiced nested arrays using a Tic-Tac-Toe board today. ✅Explored how indexing works in JavaScript by accessing valid, invalid, and negative indexes through the console. • Learned - Errors and undefined values help in understanding how JavaScript actually behaves under the hood. #Day17 #JavaScript #WebDevelopment #FrontendDevelopment
To view or add a comment, sign in
-
-
I created a simple visual guide explaining the Node.js Event Loop. Understanding execution order helps prevent blocking issues and performance bugs. Let me know if you’d like a deeper breakdown 👇 #nodejs #javascript #backend #eventloop #webdevelopment
To view or add a comment, sign in
-
⚠️ JavaScript Async Error That Slips Into Production Look at this code: try { setTimeout(() => { throw new Error('Boom'); }, 0); } catch (e) { console.log('Caught'); } Most expect the error to be caught. It won’t be. Async errors don’t bubble to outer try/catch. They live in a different execution context. Handle errors where async code runs. #JavaScript #AsyncJavaScript #ErrorHandling #NodeJS #WebDevelopment #JSConcepts #CleanCode #SoftwareEngineering
To view or add a comment, sign in
-
-
JavaScript: Window vs. Document Explained! 🤯 Ever wonder about the difference between window and document in JavaScript? 🤔 This quick short breaks down these fundamental browser objects. Get ready to understand the browser's global object vs. the HTML content! #JavaScript #WebDevelopment #Frontend #CodingTips #WindowVsDocument
JavaScript: Window vs. Document Explained! 🤯
To view or add a comment, sign in
-
JavaScript: Window vs. Document Explained! 🤯 Ever wonder about the difference between window and document in JavaScript? 🤔 This quick short breaks down these fundamental browser objects. Get ready to understand the browser's global object vs. the HTML content! #JavaScript #WebDevelopment #Frontend #CodingTips #WindowVsDocument
To view or add a comment, sign in
-
⚡ JavaScript & TypeScript Daily Refresher #116 👉 What is a prototype in a JavaScript object? 💡 A prototype is an internal object that JavaScript uses for inheritance. When a property or method isn’t found on an object, JavaScript looks it up in its prototype chain. ✨ I post daily JS/TS refreshers — follow for the next one! #JavaScript #TypeScript #Prototypes #WebDevelopment
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