Day 9 of 100 🔥 We called greet() and used num BEFORE declaring them. One works perfectly. One gives a surprise. 😱 Comment down 👇 No googling! Hint: JavaScript secretly moves some things to the top of the code before running it. But it doesn't move everything the same way! 👀 This concept is called HOISTING — and it's one of the most asked JS interview questions ever! Full explanation tonight in the comments! #100DaysOfCode #JavaScript #CodingInterview #JavaScriptTips #WebDevelopment
JavaScript Hoisting Explained
More Relevant Posts
-
🚀 Day 17/30 – slice() vs splice() in JavaScript These two methods look similar but behave very differently 👇 🔹 slice() Returns a new array Does NOT modify original array Used to extract elements 🔹 splice() Modifies the original array Can add/remove elements Used for updating the array 💡 In simple terms: 👉 slice = copy 👉 splice = change learn with w3schools.com #Day17 #FrontendDeveloper #JavaScript #InterviewPreparation #WebDevelopment #30DaysChallenge JavaScript Mastery
To view or add a comment, sign in
-
-
Made a visual to understand Linked Lists in JavaScript at a glance. Internal structure, Big O trade-offs, and when to use them — all in one diagram. #JavaScript #DataStructures #Algorithms #SoftwareEngineering
To view or add a comment, sign in
-
-
Day 10 of 100 🎉 — Double digits!! In JavaScript, there is ONE value that is NOT equal to itself. Not a bug. Not a mistake. It's by design. 😱 Comment down 👇 5 lines — 5 answers! Hint: Its name literally says "Not a Number" — yet typeof says it IS a number. And isNaN vs Number.isNaN behave differently too. This one has LAYERS! 🧅 Full explanation in the comments tonight! #100DaysOfCode #JavaScript #CodingInterview #JavaScriptTips #WebDevelopment
To view or add a comment, sign in
-
-
🚀 Day 14/30 of My JavaScript Challenge Solved LeetCode 2715 - Timeout Cancellation ✅ 💡 What I Learned Today: ⏳ How setTimeout() delays function execution ❌ How clearTimeout() cancels a scheduled task 🔁 Returning functions from functions (Higher-Order Functions) 🧠 Managing async behavior in JavaScript 📌 Approach: Created a cancellable function that schedules execution using setTimeout(). Then returned a cancelFn which uses clearTimeout() to stop execution before the delay ends. ✨ Key Insight: JavaScript timers can be controlled dynamically, which is useful in search debouncing, API calls, and UI interactions. #JavaScript #LeetCode #30DaysChallenge #WebDevelopment #AsyncJavaScript #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
I've been writing JavaScript for over a year. Thought I understood var, let, and const. I didn't. "var a" inside a block accessible outside. Prints "10". "let b" inside the same block, try to access it outside and you get: ReferenceError: b is not defined Same block. Same code. Completely different behavior. Turns out var lives in global memory. let and const get their own separate block scope. Once the block is done, they're gone. This is why going back to fundamentals matters #JavaScript #WebDev #LearnInPublic #NamasteJavaScript
To view or add a comment, sign in
-
-
Day 2/100 of JavaScript 🚀 Today’s Topic: "let", "const", "var", hoisting and TDZ. "var", "let", and "const" are used to declare variables, but they differ in scope and initialization behavior - "var" is function-scoped and during the creation phase it gets initialized with "undefined", so it can be accessed before assignment. - "let" and "const" are block-scoped and are registered in memory during creation, but not initialized immediately. This leads to TDZ (Temporal Dead Zone) a phase where the variable exists in memory but remains uninitialized and cannot be accessed. Accessing "let" or "const" variables before initialization results in a ReferenceError. - "const" must be initialized at declaration and cannot be reassigned. - "let" allows reassignment but not redeclaration in the same scope. These differences make "let" and "const" more predictable and safer compared to "var". #Day2 #JavaScript #100DaysOfCode
To view or add a comment, sign in
-
Flattening arrays in JavaScript doesn’t have to be complicated 👇 Instead of writing long logic, just remember this: 🔹 Use flat(Infinity) 🔹 It converts nested arrays into a single-level array in one line. For interviews, knowing the recursive approach gives you an extra edge. #JavaScript #WebDevelopment #CodingTips #Frontend #LearnToCode
To view or add a comment, sign in
-
-
Ever wondered why changing employee1 also changes employee in JavaScript? 🤯 It’s the classic Reference Trap—objects are stored in the heap, and the = operator only copies the reference, not the object itself. In my latest video, I break down how memory references work and why mastering Pass by Reference is key to writing bug-free code. 👉 Watch the full explanation and level up your JavaScript skills! 🎬 #JavaScript #CodingTips #WebDevelopment #ProgrammingConcepts
To view or add a comment, sign in
-
Implemented Selection Sort in JavaScript, where the smallest element is selected in each iteration and placed at its correct position. A simple yet effective way to understand sorting fundamentals and in-place operations. #JavaScript hashtag#DSA hashtag#Algorithms hashtag#Coding hashtag#WebDevelopment
To view or add a comment, sign in
-
-
#4 Currying in JavaScript: When it actually pays off Currying looks weird at first, but it solves a very practical problem: reuse. Currying is one of those JavaScript patterns that feels unusual at first, but it can make your code much more flexible. Instead of passing all arguments at once, you pass them one by one: f(a)(b)(c). That makes it easier to reuse functions when some values stay the same and others change often. Here’s the link to the post: https://lnkd.in/dkhKsRYa #javascript #react #node #interview
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