🚀 Day 88 of My #100DaysOfCode Challenge I thought I knew JavaScript… until I found these 🤯 Today I came across some weird (but real) JavaScript facts that honestly surprised me. Sharing here because I know I’m not the only one who didn’t know this 👇 💡 Things JavaScript does that feel illegal 😅 1️⃣ NaN is not equal to itself console.log(NaN === NaN); // false Yes… even JavaScript is confused here. 2️⃣ typeof null = "object" console.log(typeof null); // "object" This is actually a bug… and it still exists. 3️⃣ Functions can behave like objects function demo() {} demo.x = 10; console.log(demo.x); // 10 I didn’t expect this at all. 4️⃣ This looks correct but it’s not console.log(15 > 10 > 5); // false JavaScript evaluates it step by step… not the way we think. 5️⃣ [] + [] = "" console.log([] + []); // "" This one really broke my brain. JavaScript is not just a language… it’s full of surprises 😄 The more I learn, the more I realize how many small things we usually ignore — but they actually matter a lot. If you knew all of these already… respect 🙌 If not, welcome to the club 🤝 #Day88 #100DaysOfCode #JavaScript #CodingJourney #WebDevelopment #LearningInPublic
5 Surprising JavaScript Facts for Developers
More Relevant Posts
-
Day 5 of My JavaScript Journey 🚀 Today, I learned about if/else statements and type conversion in JavaScript. The if/else statement is used to control the flow of a program based on conditions. Example: if (age > 18) { console.log("Adult"); } else { console.log("Not an adult"); } I also learned about type conversion and coercion. • Type conversion is when we manually change a value from one type to another. • Type coercion is when JavaScript automatically converts types behind the scenes. For example: "5" + 2 = "52" (coercion happens) One thing that stood out to me: JavaScript can behave unexpectedly if you don’t understand type coercion. Key takeaway: Always be mindful of data types when writing conditions and operations. #JavaScript #WebDevelopment #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 39/50 – Scope in JavaScript Today I learned about Scope in JavaScript, which defines where variables can be accessed in a program. 🔹 Scope determines the visibility and accessibility of variables. 📌 Types of Scope in JavaScript 1️⃣ Global Scope – Variables declared outside any function can be accessed anywhere. let name = "Priyanka"; function show() { console.log(name); } show(); 2️⃣ Function Scope – Variables declared inside a function are accessible only within that function. function test() { let msg = "Hello"; console.log(msg); } test(); 3️⃣ Block Scope – Variables declared with let and const inside {} are block-scoped. if(true){ let x = 10; console.log(x); } 4️⃣ Local Scope – Variables declared inside a block or function are local to that area. 💡 Key Learnings: ✅ var → function scoped ✅ let and const → block scoped ✅ Scope helps avoid variable conflicts ✅ Improves code security and readability Thanks for mentors 10000 Coders Raviteja T Abdul Rahman #Day39 #50DaysOfCode #JavaScript #WebDevelopment #FrontendDeveloper #CodingJourney #LearningEveryday
To view or add a comment, sign in
-
-
Day 7 of My JavaScript Journey 🚀 Today, I learned about the switch statement and the difference between statements and expressions in JavaScript. The switch statement is used as an alternative to multiple if/else conditions, especially when dealing with specific values. Example: switch(day) { case "Monday": console.log("Start of the week"); break; default: console.log("Another day"); } I also learned the difference between statements and expressions: • An expression produces a value Example: 5 + 3 • A statement performs an action Example: if (condition) { ... } One key insight: Understanding this difference helps in writing cleaner and more predictable code. Key takeaway: switch is used for cleaner condition handling and understand when you're producing a value vs performing an action. #JavaScript #WebDevelopment #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 89 of My #100DaysOfCode Challenge I thought JavaScript automatically manages memory… so we don’t have to worry about it, right? 🤔 Wrong. Today I learned about something most beginners ignore — Garbage Collection in JavaScript. 💡 What actually happens? JavaScript automatically removes unused memory using something called Garbage Collection. It works on a simple idea: 👉 If something is not reachable, it gets removed from memory. 🧠 Example let user = { name: "Tejal" }; user = null; // now previous object becomes unreachable Now JavaScript will automatically clean this memory. --- ⚠️ But here’s the real problem… Even with automatic memory cleanup, memory leaks can still happen. Some common reasons: • Unused event listeners • Closures holding references • Global variables not cleared --- 💭 What I realized I used to think memory management is not my problem as a developer… But now I understand: 👉 Writing clean code also means not holding unnecessary memory --- JavaScript handles a lot for us… but understanding what’s happening behind the scenes makes a huge difference. Learning something new every day 💻✨ #Day89 #100DaysOfCode #JavaScript #WebDevelopment #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
🔄 JavaScript is single-threaded — yet somehow handles async perfectly. Most devs I've met can write async code, but can't explain why it works. Once this mental model clicked for me, I stopped fighting JavaScript and started working with it. The Event Loop in 30 seconds: When JS hits an async task (setTimeout, fetch, event listener), it doesn't wait. It hands the task off → to the Web APIs (browser/Node handles it) The result waits → in the Callback Queue The Event Loop checks → "Is the call stack empty?" Only then → the callback runs Here's the part most tutorials skip 👇 Promises don't go to the Callback Queue. They go to the Microtask Queue — which runs before setTimeout, every single time.
To view or add a comment, sign in
-
-
🚀 Day 1/30 – JavaScript Challenge LeetCode 2667 – Create Hello World Function 🧩 Problem: Write a function that returns a new function. That new function should always return "Hello World", no matter what arguments are passed. 🧠 Explanation: createHelloWorld() returns another function. The returned function uses (...args) to accept any number of arguments. But we ignore all inputs and always return "Hello World". 💡 Key Concept: This problem is based on: Higher Order Functions (function returning function). Rest Parameters (...args). Function independence from input. #javascript #30Days #Leetcode
To view or add a comment, sign in
-
-
🚀 Day 1/30 — JavaScript Journey Begins “You’re not bad at JavaScript… You just learned it the WRONG way.” Most beginners jump straight into frameworks like React… Without understanding the language itself. That’s the biggest mistake. ❌ Today, we fix that. 👇 🔥 What I Learned Today: ✅ What is JavaScript (and why it runs everywhere) ✅ How JS works in the browser ✅ Variables (let, const, var) — the RIGHT way ✅ Basic data types (string, number, boolean, null, undefined) 💡 Reality Check: If your foundation is weak… No framework can save you. Strong basics = Strong developer. 🎯 Day 1 Task: ✔️ Write 10 variable examples ✔️ Experiment in browser console ✔️ Understand let vs const deeply ⚡ Commitment: I will show up for 30 days. No excuses. No shortcuts. 💬 Comment “DAY 1” if you’re starting with me 🔁 Follow for daily JavaScript mastery #JavaScript #WebDevelopment #CodingJourney #LearnToCode #30DaysChallenge
To view or add a comment, sign in
-
-
Day 14 of my JavaScript journey 🚀 Built a Quiz Game using HTML, CSS, and JavaScript. Users can answer multiple-choice questions, get instant feedback, and track their score. This project helped me practice: • DOM manipulation • Event handling • Conditional logic • Dynamic score tracking 🔗 Live Demo: https://lnkd.in/gSjTeEFb 💻 GitHub Repo: https://lnkd.in/gAp_RjRK Building more interactive and logic-based projects day by day. 💻 #JavaScript #WebDevelopment #FrontendDeveloper #100DaysOfCode #CodingJourney
To view or add a comment, sign in
-
Day 4 of my JavaScript learning journey. Today I learned one of the most confusing concepts so far: Hoisting. I tried something strange. greet(); function greet() { console.log("Hello!"); } The function worked even before it was defined. That’s because of hoisting. JavaScript reads the whole code first and moves function declarations to the top internally. But variables behave differently. console.log(x); var x = 5; This prints undefined, not 5. And if we use let or const, JavaScript throws a ReferenceError. This area is called the Temporal Dead Zone. My takeaway today: Always declare variables before using them. Day 4 done. JavaScript keeps getting more interesting. What JavaScript concept confused you the most when you first learned it? #JavaScript #LearningInPublic #WebDevelopment #100DaysOfCode #Frontend
To view or add a comment, sign in
-
-
🚀 Day 947 of #1000DaysOfCode ✨ The Shortest JavaScript Program (You’ll Be Surprised 😮) This is one of those concepts that looks super simple… but completely changes how you see JavaScript. In today’s post, I’ve broken down the shortest possible JavaScript program — and trust me, it’s not just about writing less code. Behind this tiny piece of code lies how JavaScript actually runs your program, creates execution context, and prepares memory before even executing a single line. Sounds crazy? Wait till you see it. This is the kind of concept that once you understand, a lot of “weird JavaScript behavior” suddenly starts making sense. If you’re serious about mastering JavaScript, you don’t want to miss this one. 👉 Swipe through the carousel — this might blow your mind 🤯 👇 Did you already know what the shortest JS program is? #Day947 #learningoftheday #1000daysofcodingchallenge #FrontendDevelopment #WebDevelopment #JavaScript #React #Next #CodingCommunity #JSDeepDive
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