TGViewer
Web Development Web Development @webdevcoursefree · 79.7K subscribers
Post #3425 4.25K
✅ Web development Interview Questions with Answers Part-3

21. What is the difference between var, let, and const? 
var is function scoped and allows redeclaration. let is block scoped and allows reassignment. const is block scoped and does not allow reassignment. I avoid var in modern code. I use const by default and let only when reassignment is required.

22. What is hoisting in JavaScript? 
Hoisting is JavaScript’s behavior of moving declarations to the top of the scope. Function declarations are fully hoisted. Variables declared with var are hoisted but initialized as undefined. let and const are hoisted but not accessible before declaration. Accessing them early throws an error.

23. What is a closure and where do you use it? 
A closure is a function that remembers variables from its outer scope, even after the outer function has finished execution. I use closures in callbacks, event handlers, and data privacy. They are common in React hooks and async code.

24. What is event bubbling and event capturing? 
Event bubbling moves from the target element up to the parent. Event capturing moves from the parent down to the target. By default, JavaScript uses bubbling. I use event delegation based on bubbling for performance.

25. What is the difference between == and ===? 
== compares values after type conversion. === compares both value and type. I always use === to avoid unexpected bugs.

26. What is the difference between arrow functions and regular functions? 
Arrow functions do not have their own this. They inherit this from the parent scope. Regular functions have their own this based on how they are called. I use arrow functions for callbacks and functional code. I use regular functions for object methods when needed.

27. What are call, apply, and bind used for? 
They control the value of this. call invokes a function with arguments passed individually. apply invokes a function with arguments as an array. bind returns a new function with this permanently set. bind is useful for event handlers and callbacks.

28. What are promises and how does async await work? 
Promises handle asynchronous operations. They represent pending, fulfilled, or rejected states. async await is syntax sugar over promises. It makes async code readable and sequential. I use try catch for error handling with async await.

29. What is the difference between setTimeout and setInterval? 
setTimeout runs code once after a delay. setInterval runs code repeatedly at fixed intervals. I clear both using clearTimeout and clearInterval. I avoid setInterval when accuracy matters.

30. What is the difference between debounce and throttle? 
Debounce delays execution until the event stops firing. Throttle limits execution to a fixed interval. I use debounce for search input. I use throttle for scroll and resize events.

Double Tap ♥️ For Part-4
  • ❤ 12
  • 👍 2
More from @webdevcoursefree
  1. Oct 16, 2026🌐 Web Development Roadmap — Part 18 HTML Lists Lists are used whenever information needs…
  2. Oct 14, 2026🌐 Web Development Roadmap — Part 17 HTML Images — <img> Tag Images make webpages more vis…
  3. Oct 13, 2026𝗧𝗢𝗣 𝗙𝗥𝗘𝗘 𝗖𝗢𝗨𝗥𝗦𝗘𝗦 𝗧𝗢 𝗕𝗢𝗢𝗦𝗧 𝗬𝗢𝗨𝗥 𝗦𝗞𝗜𝗟𝗟𝗦 𝗜𝗡 𝟮𝟬𝟮𝟲! Explor…
  4. Oct 12, 2026For example: Go to Profile → <a> Submit Form → <button> Open Article → <a> Delete Account…
  5. Oct 12, 2026🌐 Web Development Roadmap — Part 16 HTML Links — Tag Links are one of the most important…
  6. Oct 12, 2026🚀 𝗪𝗵𝗶𝗰𝗵 𝗧𝗲𝗰𝗵 𝗦𝗸𝗶𝗹𝗹 𝗪𝗶𝗹𝗹 𝗬𝗼𝘂 𝗠𝗮𝘀𝘁𝗲𝗿 𝗶𝗻 𝟮𝟬𝟮𝟲? Want to buil…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →