🚀 JavaScript isn’t just a language — it’s pure magic that runs the web! Let’s do a quick JS challenge 👇 👉 Guess what this code will print: console.log(typeof null); Most people say "null", but surprise — the answer is actually "object" 😲 That’s one of JavaScript’s oldest quirks — a bug that became a feature! It reminds us that no language is perfect, but JavaScript’s flexibility and weirdness are what make it so powerful. 💪 💬 Now your turn: What’s the most confusing or fun JS behavior you’ve encountered? Drop it in the comments — let’s see who can out-weird JavaScript today! ⚡ #JavaScript #Coding #WebDevelopment #ProgrammingHumor #LearnToCode
JavaScript's quirks: Guess the output of typeof null
More Relevant Posts
-
Today I spent some time understanding Hoisting in JavaScript, and it really helped me see how JS works behind the scenes. Here’s what I learned: 🔹 JavaScript reads the code in two phases: 1️⃣ 𝐌𝐞𝐦𝐨𝐫𝐲 𝐂𝐫𝐞𝐚𝐭𝐢𝐨𝐧 𝐏𝐡𝐚𝐬𝐞 – where variable & function declarations are hoisted 2️⃣ 𝐄𝐱𝐞𝐜𝐮𝐭𝐢𝐨𝐧 𝐏𝐡𝐚𝐬𝐞 – where the actual code runs 🔹 var is hoisted and set to undefined, so accessing it early doesn’t throw an error. 🔹 let & const are also hoisted but not initialized. They stay in the Temporal Dead Zone, which is why accessing them before the declaration gives a ReferenceError. 🔹 Function declarations are fully hoisted, so they can be called before they are written in the code. Understanding this concept made a lot of things clearer, especially why some errors happen in JS. Learning step by step and enjoying the process! 🚀 #JavaScript #LearningJourney #WebDevelopment #Frontend #Hoisting #10000coders #10kcoders
To view or add a comment, sign in
-
-
JavaScript for 15 Days – Day 5: Functions Today, You will learn about Functions, one of the most important concepts in JavaScript. A function is basically a reusable block of code that performs a specific task. It helps you write cleaner, more organized, and less repetitive code. Example: function greet(name) { return `Hello, ${name}!`; } console.log(greet("Moussa")); // Hello, Moussa! Why functions matter: - They make your code reusable and modular. - They improve readability. - They help you manage logic step by step. JavaScript also supports arrow functions and function expressions, which you’ll explore in slides! #JavaScript #FrontendDevelopment #CodingJourney #LearnToCode #WebDevelopment #15DaysJS #DevPerDay
To view or add a comment, sign in
-
JavaScript Concept — “The Power of Closures” 💭 Ever wondered how JavaScript functions “remember” the variables around them? That’s the magic of Closures — one of JavaScript’s most elegant features. Closures allow a function to access variables from its outer scope, even after that scope has closed. This concept powers some of the most powerful patterns in JS — from private variables to event handlers. Here’s a small example 👇 function counter() { let count = 0; return function() { count++; return count; }; } const add = counter(); console.log(add()); // 1 console.log(add()); // 2 It’s simple, elegant, and shows how deep JavaScript really is. #JavaScript #WebDevelopment #Coding #Frontend #Learning
To view or add a comment, sign in
-
JavaScript thing I randomly remembered today 😅 You know how let and const throw an error if you try to use them before declaring? That weird phase has a name — Temporal Dead Zone (TDZ). console.log(a); // ❌ ReferenceError let a = 5; It’s not that a doesn’t exist. It’s there... just not initialized yet. Basically, JS says “I know you declared it, but don’t touch it till I’m ready.” 😂 var doesn’t have this — which is why it caused chaos in old codebases. Crazy part? This all happens before your code even runs. JavaScript is wild sometimes 😅 #JavaScript #WebDevelopment #CodingLife #Frontend
To view or add a comment, sign in
-
-
JavaScript for 15 Days – Day 4: Why We Still Use ; One of the smallest symbols in JavaScript — the semicolon ( ; ) — often causes big debates. Do we still need it? Technically, JavaScript can insert semicolons automatically (ASI), but it doesn’t always get it right. Example: return "Hello"; // ❌ returns undefined Using ; makes your code more explicit, safe, and consistent — especially in larger projects or when your code is minified. Lesson learned: Semicolons might be optional, but clean and predictable code is not . #JavaScript #FrontendDevelopment #LearnToCode #CodingJourney #WebDevelopment #15DaysJS #DevPerDay
To view or add a comment, sign in
-
The Event Loop — The Beating Heart of JavaScript ❤️ Ever wondered how JavaScript manages to do so much — while still being single-threaded? That’s where the Event Loop comes in. Let’s break it down 👇 JavaScript runs in one thread — it can’t multitask by itself. But when you use things like 👉 setTimeout() 👉 Promises 👉 async/await 👉 event listeners they get handled outside the main thread — by the browser’s API — and are then pushed into the callback queue or microtask queue. The Event Loop constantly checks: > “Is the call stack empty? If yes, let’s push the next task from the queue.” That’s how JavaScript gives the illusion of multitasking. Synchronous code → runs first. Then microtasks (Promises) → then macrotasks (timeouts, intervals, etc.). Once you truly understand this, async behavior, callback hell, and even race conditions start making sense. 🔥 So next time someone says JS is “single-threaded,” just smile — because you know the Event Loop is secretly doing all the heavy lifting 😎 #JavaScript #EventLoop #AsyncProgramming #WebDevelopment #Frontend #NodeJS #ReactJS #MERNStack #CodeNewbie #100DaysOfCode #JS #TechCommunity #Programming #CleanCode #LearnJavaScript #SoftwareDevelopment #CodingJourney #DeveloperCommunity #TrendingNow
To view or add a comment, sign in
-
-
Day 27 – Mindset Session on JavaScript Today’s session was truly insightful — it wasn’t just about coding, but about developing the right mindset to understand JavaScript deeply. Our mentor and guide, Harsh Vandana Sharma, explained the importance of JavaScript in web development and how it forms the backbone of modern interactive websites. This session helped me realize that learning JavaScript isn’t just about syntax — it’s about thinking like a developer. #Day27 #100DaysOfCode #JavaScript #WebDevelopment #FrontendDevelopment #LearningByDoing #SheriansCodingSchool #DeveloperMindset
To view or add a comment, sign in
-
-
New DevByte Video Alert! We just dropped a brand new tutorial: “Introduction to JavaScript” In this session, we explore the language that brings life and interactivity to websites JavaScript! You’ll learn how it connects with HTML & CSS, the basic syntax, and why every aspiring developer should master it. 💡 Perfect for beginners starting their journey into web development. 🎯 Watch now on YouTube 👉 https://lnkd.in/dV5g6RVE Let’s keep building the next generation of developers one byte at a time. #DevByte #DevByteCommunity #JavaScript #Coding #WebDevelopment #TechEducation #LearnToCode #ChristianChika
To view or add a comment, sign in
-
-
The JavaScript Event Loop — The Hidden Multitasking Hero If JavaScript is single-threaded, how does it look like it’s doing so many things at once? 🤔 Meet the Event Loop — the patient snake 🐍 that makes everything flow smoothly. 🧩 In simple words: JS runs one thing at a time (main thread). When async tasks finish, the Event Loop decides when to bring them back into action — like a patient teacher calling students one by one from different queues 😄 ✨ Takeaway: --> Promises (microtasks) always run before setTimeout (macrotasks). --> JS isn’t truly “multi-threaded” — it’s just a great illusionist. 🎩 Next up → 🧠 “this” Keyword — The Most Confused Owl in JavaScript 🦉 #JavaScript #EventLoop #AsyncJS #WebDevelopment #FrontendDevelopment #CodingCommunity #100DaysOfCode #LearnToCode #MERNStack #ProgrammingHumor
To view or add a comment, sign in
-
-
Leveling up my front-end fundamentals one small project at a time! 🚀 Here’s a look at my Background Colour Changer — a quick video that captures the simplicity and power of event listeners and manipulating the Document Object Model (DOM) in JavaScript. Small projects like this are crucial for reinforcing core concepts before diving into larger frameworks. What's the best small project you've built to practice a core skill? Let me know! #CodingJourney #JavaScript #CSS #WebDev #LearningToCode
To view or add a comment, sign in
More from this author
Explore related topics
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