JavaScript
JavaScript
June 19, 2025 at 11:33 AM
✅ *10 JavaScript Interview Questions (With Answers)* 💻📜 1️⃣ *Q:* *What are closures in JavaScript?* *A:* A closure is when a function "remembers" variables from its outer scope even after the outer function has returned. 2️⃣ *Q:* *Explain hoisting.* *A:* JavaScript hoists declarations (not initializations) of variables and functions to the top of their scope. 3️⃣ *Q:* *What is the difference between `null` and `undefined`?* *A:* - `undefined`: variable declared but not assigned. - `null`: intentional absence of value. 4️⃣ *Q:* *What are arrow functions and how do they differ from regular functions?* *A:* Arrow functions have shorter syntax and don’t bind their own `this`, `arguments`, or `super`. 5️⃣ *Q:* *What is the difference between `map()`, `forEach()`, and `filter()`?* *A:* - `map()`: transforms and returns a new array. - `forEach()`: runs a function on each item, no return. - `filter()`: returns items that match a condition. 6️⃣ *Q:* *What is the event loop?* *A:* It allows JavaScript to handle async operations by queuing tasks (callbacks) and executing them after the current call stack is clear. 7️⃣ *Q:* *What’s the difference between `==` and `===`?* *A:* - `==`: loose equality (with type conversion). - `===`: strict equality (no type conversion). 8️⃣ *Q:* *What are promises?* *A:* Promises represent the result of an asynchronous operation—either resolved or rejected. 9️⃣ *Q:* *What is a debounce function?* *A:* A technique to limit how often a function is executed, useful for performance (e.g., resizing, input events). 🔟 *Q:* *What is the difference between synchronous and asynchronous code?* *A:* - Synchronous: blocks execution. - Asynchronous: non-blocking, continues execution using callbacks/promises/async-await. 💬 *Double Tap ❤️ for more!*
❤️ 👍 💰 😢 🙊 🙏 🤕 🫦 43

Comments