𝗘𝗻𝗱-𝗼𝗳-𝗬𝗲𝗮𝗿 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲: 𝟮𝟱 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀 𝗘𝘃𝗲𝗿𝘆 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 𝗠𝘂𝘀𝘁 𝗞𝗻𝗼𝘄 Before this year ends, test how solid your JavaScript fundamentals really are. No tutorials. No Google. Just you vs concepts. 🔹 Fundamentals 1️⃣ What are primitive and non-primitive data types? 2️⃣ Difference between var, let, and const? 3️⃣ What are truthy and falsy values? Name all falsy values. 4️⃣ What is type coercion? Give an example. 5️⃣ == vs === — what’s the real difference? 🔹 Scope & Execution 6️⃣ What is hoisting in JavaScript? 7️⃣ Global scope vs function scope vs block scope 8️⃣ What is the execution context? 9️⃣ What is the call stack? 🔟 What is lexical scope? 🔹 Functions & Closures 1️⃣1️⃣ What is a closure? Explain with a real-world example 1️⃣2️⃣ Normal functions vs arrow functions 1️⃣3️⃣ The this keyword — behavior in different contexts 1️⃣4️⃣ What are higher-order functions? 1️⃣5️⃣ What is function currying? 🔹 Arrays & Objects 1️⃣6️⃣ map vs filter vs reduce 1️⃣7️⃣ How do you remove duplicates from an array? 1️⃣8️⃣ Shallow copy vs deep copy 1️⃣9️⃣ How do you merge two objects? 2️⃣0️⃣ What is object destructuring? 🔹 Asynchronous JavaScript 2️⃣1️⃣ What is callback hell? How do you avoid it? 2️⃣2️⃣ Promises vs async/await 2️⃣3️⃣ What is the event loop? 2️⃣4️⃣ setTimeout vs setInterval vs requestAnimationFrame 2️⃣5️⃣ Microtasks vs macrotasks 🎯 Last-Day Challenge Rules ✔ Answer without Google ✔ Explain concepts in your own words ✔ Mark weak areas and revise ✔ End the year strong in JavaScript 📌 Save this for interview prep 🔁 Repost to challenge other developers 𝗜 𝗵𝗮𝘃𝗲 𝗽𝗿𝗲𝗽𝗮𝗿𝗲𝗱 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗣𝗿𝗲𝗽𝗮𝗿𝗮𝘁𝗶𝗼𝗻 𝗚𝘂𝗶𝗱𝗲 𝗳𝗼𝗿 𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿. 𝗚𝗲𝘁 𝘁𝗵𝗲 𝗚𝘂𝗶𝗱𝗲 𝗵𝗲𝗿𝗲 👉 https://lnkd.in/dygKYGVx #JavaScript #Frontend #WebDevelopment #InterviewPreparation #JSBasics #Programming #SoftwareEngineering #DeveloperJourney
JavaScript End-of-Year Challenge: 25 Questions to Test Your Fundamentals
More Relevant Posts
-
🔁 JavaScript Event Loop: Microtasks vs Callback Queue (Explained Clearly) If you want to truly understand asynchronous JavaScript, you must understand how the Event Loop prioritizes tasks. This concept is: ✅ A favorite interview topic ✅ A common source of real-world bugs ✅ Essential for writing predictable, performant JS Let’s break it down 👇 🧩 Two Queues Every JavaScript Developer Should Know 1️⃣ Callback Queue (Macrotasks) Handles: setTimeout setInterval setImmediate I/O callbacks How it works: Executes after the call stack is empty Runs only when no microtasks are pending Lower priority ⬇️ 2️⃣ Microtask Queue Handles: Promise.then / catch / finally async / await MutationObserver queueMicrotask() How it works: Executes immediately after synchronous code Fully drained before moving to the callback queue Higher priority ⬆️ 💻 Example Code console.log('1. Sync'); setTimeout(() => { console.log('2. Callback Queue'); }, 0); Promise.resolve().then(() => { console.log('3. Microtask Queue'); }); console.log('4. Sync'); 📤 Output 1. Sync 4. Sync 3. Microtask Queue 2. Callback Queue ⚙️ Execution Flow Run all synchronous code Execute all microtasks Execute one macrotask Repeat the cycle 🎯 Why This Matters Explains why Promise callbacks run before setTimeout(0) Helps debug race conditions and timing issues Critical for performance-sensitive UI logic Commonly asked in JavaScript & Frontend interviews Once this clicks, async JavaScript stops feeling “magical” and becomes predictable. #JavaScript #EventLoop #AsyncJavaScript #FrontendDevelopment #WebDevelopment #Promises #Microtasks #JavaScriptTips #InterviewPreparation #CodingConcepts #FrontendEngineer
To view or add a comment, sign in
-
-
📘 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗡𝗼𝘁𝗲𝘀 – 𝗙𝗿𝗼𝗺 𝗙𝘂𝗻𝗱𝗮𝗺𝗲𝗻𝘁𝗮𝗹𝘀 𝘁𝗼 𝗔𝗱𝘃𝗮𝗻𝗰𝗲𝗱 𝗖𝗼𝗻𝗰𝗲𝗽𝘁𝘀 JavaScript is the core language of the web, and mastering it is essential for building interactive, high-performance applications. These JavaScript Notes are designed for quick revision, deep understanding, and interview preparation — focusing on concepts used in real-world development 👇 🔹 What These JavaScript Notes Cover 🧠 Core Fundamentals 📌 Data types (primitive & non-primitive) 📌 var, let, const & scope 📌 Type coercion & equality (== vs ===) 📌 Truthy & falsy values ⚙️ Execution & Scope 📌 Execution context & call stack 📌 Hoisting & lexical scope 📌 Closures & scope chain 🔁 Functions & Objects 📌 Normal vs arrow functions 📌 this keyword behavior 📌 call, apply & bind 📌 Prototypes & inheritance ⏳ Async JavaScript 📌 Callbacks, promises & async/await 📌 Event loop (microtasks vs macrotasks) 📌 Error handling in async code 🚀 Modern JavaScript (ES6+) 📌 Destructuring & spread operator 📌 map, filter, reduce 📌 Modules (ESM vs CommonJS) 📌 Optional chaining & nullish coalescing 🎯 Who Are These Notes For? 👨💻 Beginners learning JavaScript 👨💻 Frontend developers revising fundamentals 👨💻 Developers preparing for JavaScript interviews 📌 Key Insight: JavaScript mastery comes from understanding how the language works internally, not memorizing syntax. 𝐿𝑒𝑡’𝑠 𝑤𝑟𝑖𝑡𝑒 𝑏𝑒𝑡𝑡𝑒𝑟 𝐽𝑎𝑣𝑎𝑆𝑐𝑟𝑖𝑝𝑡 🚀 𝗜 𝗵𝗮𝘃𝗲 𝗽𝗿𝗲𝗽𝗮𝗿𝗲𝗱 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗣𝗿𝗲𝗽𝗮𝗿𝗮𝘁𝗶𝗼𝗻 𝗚𝘂𝗶𝗱𝗲 𝗳𝗼𝗿 𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿. 𝗚𝗲𝘁 𝘁𝗵𝗲 𝗚𝘂𝗶𝗱𝗲 𝗵𝗲𝗿𝗲 👉 https://lnkd.in/dygKYGVx 𝗜’𝘃𝗲 𝗯𝘂𝗶𝗹𝘁 𝟴+ 𝗿𝗲𝗰𝗿𝘂𝗶𝘁𝗲𝗿-𝗿𝗲𝗮𝗱𝘆 𝗽𝗼𝗿𝘁𝗳𝗼𝗹𝗶𝗼 𝘄𝗲𝗯𝘀𝗶𝘁𝗲𝘀 𝗳𝗼𝗿 𝗙𝗿𝗼𝗻𝘁𝗲𝗻𝗱 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿𝘀. 𝗚𝗲𝘁 𝘁𝗵𝗲 𝗽𝗼𝗿𝘁𝗳𝗼𝗹𝗶𝗼𝘀 𝗵𝗲𝗿𝗲 👉 https://lnkd.in/drqV5Fy3 #JavaScript #JavaScriptNotes #FrontendDevelopment #WebDevelopment #SoftwareEngineering #JSInterview #LearnJavaScript
To view or add a comment, sign in
-
2 days crash JavaScript prep for interview. I’d split it cleanly: Day 1 → JavaScript (deep fundamentals) Day 2 → Framework / Library + machine coding Because if JavaScript reasoning is weak, no framework knowledge will save you. Day 1: JavaScript (go deep, not wide) These are the high-ROI JavaScript topics I would focus on. Not to memorize but to be able to explain, reason, and handle follow-ups. Execution & Scope - Execution context & call stack - var, let, const (scope + hoisting + TDZ) - Lexical scope - Closures (real bugs, not definitions) Functions & this - this binding (default, implicit, explicit, new) - call, apply, bind - Arrow functions vs normal functions - Function currying & partial application (conceptually) Async JavaScript - Event loop (call stack, task queue, microtasks) - Promises & chaining - async / await (error handling, sequencing) - Race conditions & stale closures - setTimeout, setInterval, requestAnimationFrame Data & References - == vs ===, truthy / falsy values - Object & array references - Deep vs shallow copy - Array methods (map, filter, reduce, find, some, every) ES6+ Core - Destructuring (edge cases & defaults) - Rest vs spread - Map, Set, WeakMap, WeakSet (why they exist) Browser & Runtime (JS-centric) - DOM events & event delegation - Debouncing vs throttling - Memory leaks in JavaScript (closures, listeners, DOM) - Why some things cannot be polyfilled You don’t need to master everything here. But for each topic, you should be able to answer: Why does this exist? Where does this break? What happens if the interviewer changes one condition? That’s Day 1 done properly. Day 2 then becomes easier. Framework concepts, React patterns, and machine coding sit on top of this foundation. If Day 1 is weak, Day 2 collapses quickly. My eBook will save you weeks of scattered prep. 📘 300+ JS and ReactJS questions 📘 60 System Design Question (HLD and LLD) 👉✅️Grab ebook here: https://lnkd.in/g9hdUJkf That’s how you go from writing UI to building robust, scalable, and performant frontend systems. #FrontendInterview #WebDevelopment #JavaScript #ReactJS #CodingTips #FrontendEngineer #TechCareers
To view or add a comment, sign in
-
🔄 Understanding Microtask Queue vs Callback Queue in JavaScript One of the most important concepts for mastering asynchronous JavaScript is understanding how the Event Loop works with different types of tasks. 📌 KEY DIFFERENCES: 1️⃣ CALLBACK QUEUE (Macrotask Queue) • Handles: setTimeout, setInterval, setImmediate, I/O operations • Processed: After the current execution stack is empty • Priority: Lower priority - executed last 2️⃣ MICROTASK QUEUE • Handles: Promises, async/await, MutationObserver, queueMicrotask() • Processed: Before moving to the next callback/macrotask • Priority: Higher priority - executed first 💡 CODE EXAMPLE: console.log('1. Sync Code'); setTimeout(() => { console.log('2. Callback Queue (setTimeout)'); }, 0); Promise.resolve() .then(() => { console.log('3. Microtask Queue (Promise)'); }); console.log('4. Sync Code'); 📊 OUTPUT: 1. Sync Code 4. Sync Code 3. Microtask Queue (Promise) 2. Callback Queue (setTimeout) ✨ EXECUTION ORDER: 1. All synchronous code executes first 2. All microtasks (Promises) execute next 3. Then callback queue (setTimeout) executes 🎯 WHY IT MATTERS: • Ensures proper async behavior in your code • Critical for interview preparation • Essential for debugging timing issues • Helps optimize performance Understanding this is KEY to becoming a proficient JavaScript developer! 🚀 #JavaScript #Frontend #EventLoop #AsyncProgramming #InterviewPrep
To view or add a comment, sign in
-
🔁 JavaScript Event Loop: Microtasks vs Callback Queue (Explained Clearly) If you want to truly understand asynchronous JavaScript, you must understand how the Event Loop prioritizes work. This topic is a favorite in interviews — and a common source of bugs in real projects. Let’s break it down in a practical way 👇 🧩 Two Queues You Must Know 1️⃣ Callback Queue (Macrotasks) This queue handles: setTimeout setInterval setImmediate I/O callbacks How it runs Executed after the call stack is empty Runs only when no microtasks are pending Priority: ⬇️ Lower 2️⃣ Microtask Queue This queue handles: Promise.then / catch / finally async / await MutationObserver queueMicrotask() How it runs Executed immediately after synchronous code Drained completely before moving to the callback queue Priority: ⬆️ Higher 💻 Example Code console.log('1. Sync'); setTimeout(() => { console.log('2. Callback Queue'); }, 0); Promise.resolve().then(() => { console.log('3. Microtask Queue'); }); console.log('4. Sync'); 📤 Output 1. Sync 4. Sync 3. Microtask Queue 2. Callback Queue ⚙️ Execution Flow 1. Run all synchronous code 2. Execute all microtasks 3. Execute one macrotask 4. Repeat the cycle 🎯 Why This Matters Explains why Promises run before setTimeout(0) Helps debug race conditions and timing bugs Critical for performance-sensitive UI logic Frequently asked in JavaScript interviews Once this clicks, async JavaScript stops feeling “magical” and starts feeling predictable. 👉 Follow Rahul R Jain for more real interview insights, React fundamentals, and practical frontend engineering content. #JavaScript #EventLoop #AsyncProgramming #FrontendDevelopment #WebDevelopment #Microtasks #Promises #InterviewPreparation
To view or add a comment, sign in
-
🤔 Ever confused by the three dots (...) in JavaScript? They look the same, but default parameters, rest, and spread solve very different problems. 🧠 JavaScript interview question What’s the difference between default parameters, rest parameters, and the spread operator? ✅ Short answer • Default parameters give fallback values • Rest collects multiple values into one • Spread expands one value into many Same syntax, different intent. 🔍 Default parameters — “Give me a fallback” Used when a function argument is missing or undefined. Instead of manual checks, JavaScript handles it for you. function greet(name = "there") { return "Hi " + name; } greet(); // "Hi there" greet("Sam"); // "Hi Sam" 🔍 Rest parameters — “Collect the leftovers” Used in function definitions to gather extra arguments into a real array. function sum(...nums) { return nums.reduce((a, b) => a + b, 0); } sum(1, 2, 3, 4); // 10 🔍 Spread operator — “Unpack things” Used in function calls, arrays, and objects to expand values. const a = [1, 2]; const b = [3, 4]; const combined = [...a, ...b]; // [1,2,3,4] With objects (shallow copy): const user = { name: "A", meta: { v: 1 } }; const copy = { ...user, role: "admin" }; ⚠️ Common misconceptions • Rest ≠ arguments (rest is a real array) • Spread does not deep clone objects • Default params apply only when value is undefined 🧩 Easy way to remember Rest gathers. Spread scatters. #javascript #frontend #webdevelopment #interviewprep #react #codingtips
To view or add a comment, sign in
-
Mutable vs Immutable in JavaScript is one of those concepts that seems simple, but interviewers love to twist it. • Immutable means the value itself cannot be directly modified • Mutable means the value itself can be modified In JavaScript, all primitive types are immutable: String, Number, Boolean, Null, Undefined, Symbol, BigInt So when you do: let a = 10; a = 20; - It may look like 'a' changed, but what actually happens is that a new value is created and the variable is reassigned. - The old value remains untouched and may later be garbage-collected. - This is also why strings behave the way they do. - You can read characters using an index, but you can’t modify them. - Any “change” to a string actually creates a new string behind the scenes. - Strings are not mutable arrays — they’re immutable primitives. let str = "immutable"; str[0] = "i"; // nothing happens Objects are different. Objects are mutable, and arrays are objects in JavaScript: arr[0] = 10 → works arr.push(4) → modifies the same array in memory Here’s an important distinction: • Mutation (same object, same memory) let obj = { x: 1 }; obj.x = 2; • Reassignment (new object, new reference) let obj = { x: 1 }; obj = { x: 2 }; Even with const, this rule stays the same. const obj = { x: 1 }; obj.x = 2; // allowed → mutation obj = { x: 2 }; // error → reassignment not allowed const prevents reassignment, not mutation. You can’t point the variable to a new object, but you can change the existing object’s properties. Because objects are mutable by default, JavaScript gives us: • Object.seal() → cannot add/remove properties, but values can change • Object.freeze() → cannot add, remove, or change anything (also applies to arrays) Takeaway : • Primitives are immutable. Reassignment creates a new value. • Objects and arrays are mutable. Mutation changes the same value in memory. #FrontendDevelopment #JavaScript #JavaScriptInterview #InterviewPrep #WebDevelopment #Mutability
To view or add a comment, sign in
-
Tagged Template Literals (The Magic Function Call) in JavaScript 🚀 𝐓𝐡𝐞 𝐌𝐚𝐠𝐢𝐜 𝐨𝐟 "𝐓𝐚𝐠𝐠𝐞𝐝 𝐓𝐞𝐦𝐩𝐥𝐚𝐭𝐞𝐬": 𝐂𝐚𝐥𝐥𝐢𝐧𝐠 𝐅𝐮𝐧𝐜𝐭𝐢𝐨𝐧𝐬 𝐖𝐢𝐭𝐡𝐨𝐮𝐭 () 🪄 𝐇𝐞𝐚𝐝𝐥𝐢𝐧𝐞: 𝐄𝐯𝐞𝐫 𝐰𝐨𝐧𝐝𝐞𝐫𝐞𝐝 𝐡𝐨𝐰 𝐬𝐭𝐲𝐥𝐞𝐝.𝐝𝐢𝐯 𝐨𝐫 𝐠𝐪𝐥 𝐰𝐨𝐫𝐤𝐬? 𝐈𝐭'𝐬 𝐧𝐨𝐭 𝐦𝐚𝐠𝐢𝐜, 𝐢𝐭'𝐬 𝐣𝐮𝐬𝐭 "𝐓𝐚𝐠𝐠𝐞𝐝 𝐓𝐞𝐦𝐩𝐥𝐚𝐭𝐞𝐬" 🧠 Hey LinkedInFamily, We all love Template Literals (backticks) for mixing variables with strings. 𝐜𝐨𝐧𝐬𝐭 𝐦𝐬𝐠 = "𝐇𝐞𝐥𝐥𝐨 ${𝐧𝐚𝐦𝐞}"; But did you know you can put a Function Name right before the backticks? This is called a 𝐓𝐚𝐠𝐠𝐞𝐝 𝐓𝐞𝐦𝐩𝐥𝐚𝐭𝐞, and it completely changes how the string is processed. 🔍 How does it work? When you use a tag (function) before a template string, the browser doesn't just return a string. Instead, it calls the function and passes: 1. An array of the plain text parts. 2. The values of all variables (${...}) as separate arguments. This gives you full control to modify, sanitize, or reformat the data before it becomes a final string. 💡 Real-World Power: This is exactly how libraries like Styled Components working! 1. They take your CSS string. 2. They process it inside the tag function. 3. They generate a unique class name and inject the styles. 🛡 My Engineering Takeaway JavaScript allows us to create our own "mini-languages" (DSLs) using this feature. It’s a powerful tool for libraries that need to parse custom structures like CSS, HTML, or SQL queries safely. 𝐒𝐭𝐨𝐩 𝐣𝐮𝐬𝐭 𝐜𝐨𝐧𝐜𝐚𝐭𝐞𝐧𝐚𝐭𝐢𝐧𝐠 𝐬𝐭𝐫𝐢𝐧𝐠𝐬. 𝐒𝐭𝐚𝐫𝐭 𝐩𝐫𝐨𝐜𝐞𝐬𝐬𝐢𝐧𝐠 𝐭𝐡𝐞𝐦 🛠️✨ Ujjwal Kumar || Software Developer || JS Architecture Enthusiast || Metaprogramming #JavaScript #WebDevelopment #TaggedTemplates #ES6 #UjjwalKumar #TheDeveloper #SoftwareEngineering #CodingTips #StyledComponents #AdvancedJS
To view or add a comment, sign in
-
-
Controlling `this` in JavaScript: Call vs. Apply vs. Bind. 🎮 One of the most common interview questions for mid-level developers is: "𝑊ℎ𝑎𝑡 𝑖𝑠 𝑡ℎ𝑒 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝐶𝑎𝑙𝑙, 𝐵𝑖𝑛𝑑, 𝑎𝑛𝑑 𝐴𝑝𝑝𝑙𝑦?" They all do the same core job: They allow you to manually set what `this` refers to inside a function. But they do it in slightly different ways. 𝐇𝐞𝐫𝐞 𝐢𝐬 𝐭𝐡𝐞 𝟏𝟎-𝐬𝐞𝐜𝐨𝐧𝐝 𝐛𝐫𝐞𝐚𝐤𝐝𝐨𝐰𝐧: 1️⃣ 𝐂𝐚𝐥𝐥 & 𝐀𝐩𝐩𝐥𝐲 (𝐓𝐡𝐞 𝐈𝐦𝐦𝐞𝐝𝐢𝐚𝐭𝐞 𝐈𝐧𝐯𝐨𝐤𝐞𝐫𝐬) Both of these execute the function 𝑖𝑚𝑚𝑒𝑑𝑖𝑎𝑡𝑒𝑙𝑦. The only difference is how they handle arguments. • 𝐂𝐚𝐥𝐥: Passes arguments individually (comma-separated). • 𝑀𝑛𝑒𝑚𝑜𝑛𝑖𝑐: 𝐂all = 𝐂ommas. • 𝐀𝐩𝐩𝐥𝐲: Passes arguments as a single Array. • 𝑀𝑛𝑒𝑚𝑜𝑛𝑖𝑐: 𝐀pply = 𝐀rray. 2️⃣ 𝐁𝐢𝐧𝐝 (𝐓𝐡𝐞 𝐏𝐥𝐚𝐧𝐧𝐞𝐫) • 𝐁𝐢𝐧𝐝: Does NOT execute the function immediately. • Instead, it returns a 𝐧𝐞𝐰 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧 𝐜𝐨𝐩𝐲 with the `this` context permanently locked (bound) to the object you specified. You can then call this new function whenever you want later. 𝐖𝐡𝐲 𝐢𝐬 𝐭𝐡𝐢𝐬 𝐮𝐬𝐞𝐟𝐮𝐥? It allows "Method Borrowing." You can use a method from one object (like a helper function) and use it on a completely different object, just by changing the `this` context! Check out the syntax comparison below! 👇 Which one do you use most often? I find `bind` essential for passing methods into React components or event listeners! #JavaScript #WebDevelopment #CodingInterviews #SoftwareEngineering #Frontend #JSConcepts
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
https://lnkd.in/dygKYGVx