All question banksWeb Development
JavaScript Questions Comprehensive collection of the most frequently asked JavaScript interview questions covering fundamentals, ES6+, async programming, DOM manipulation, objects, arrays, functions, and advanced concepts. Each answer is concise, detailed, and interview-ready.
1. What is event bubbling in JavaScript? Intermediate 2. Explain bind, call and apply methods in JavaScript Intermediate 3. What is the difference between map and forEach? Beginner 4. What is hoisting in JavaScript? Intermediate 5. What is the difference between bind and call? Intermediate 6. What is the 'this' keyword in JavaScript? Intermediate 7. What is a callback function? Beginner 8. What is callback hell? Intermediate 9. What is the difference between callback, promise, and async-await? Intermediate 10. Explain async-await and its advantages Intermediate 11. What is a closure in JavaScript? Advanced 12. What is currying in JavaScript? Advanced 13. What is a memory leak in JavaScript? Advanced 14. Explain the internal working mechanism of JavaScript Advanced 15. What is lexical scope? Intermediate 16. Explain different Promise methods and when to use them Intermediate 17. What are the different ways to create objects in JavaScript? Intermediate 18. What are design patterns and how do you implement them? Advanced 19. What is a higher-order function? Intermediate 20. What is an event emitter and how to use it? Intermediate 21. What is a prototype in JavaScript? Intermediate 22. What is CORS and why is it important? Intermediate 23. What is the return value of the reduce method? Intermediate 24. Does JavaScript have a Map data type? Beginner 25. How do you use Object-Oriented Programming in JavaScript? Intermediate 26. What is Functional Programming in JavaScript? Advanced 27. What is the difference between for loop and array.map? Intermediate 28. Explain JavaScript execution stack and event loop Advanced 29. What is middleware and where is it used? Intermediate 30. What are array methods like some and every? Beginner 31. What is destructuring in JavaScript? Beginner 32. What is the spread operator? Beginner 33. What is the difference between undefined and null? Beginner 34. What are template literals in JavaScript? Beginner 35. Why is Node.js single-threaded? Intermediate 36. What are shallow cloning and deep cloning? Intermediate 37. What is the difference between require and import? Intermediate 38. What is event capturing in JavaScript? Intermediate 39. What is the difference between Object.freeze and Object.seal? Intermediate 40. How does the const keyword work with objects? Beginner 41. Can values be added to const arrays? Beginner 42. What is the Singleton design pattern? Advanced 43. What distinguishes arrow functions from regular functions? Intermediate 44. What are ES6 features? Intermediate 45. What is the difference between == and ===? Beginner 46. What is the event loop? Advanced 47. What is event delegation? Intermediate 48. What is debouncing in JavaScript? Intermediate 49. What is throttling in JavaScript? Intermediate 50. What is memoization? Advanced 51. What is Promise.all()? Intermediate 52. What is deep equality? Intermediate 53. What is Array.prototype.reduce()? Intermediate 54. How do you flatten arrays? Intermediate 55. How do you merge objects and arrays? Intermediate 56. What is getElementsByClassName? Beginner 57. What is the difference between var, let, and const? Beginner 58. What is strict mode? Intermediate 59. What is the Document Object Model (DOM)? Beginner 60. What is the difference between innerHTML and innerText? Beginner 61. What is the difference between window and document objects? Beginner 62. What is the Browser Object Model (BOM)? Intermediate 63. What are cookies, localStorage, and sessionStorage? Intermediate 64. What is the difference between synchronous and asynchronous? Intermediate 65. What is AJAX? Intermediate 66. What is the difference between XMLHttpRequest and fetch()? Intermediate 67. What are JavaScript data types? Beginner 68. How do you iterate over objects and arrays? Intermediate 69. What is the difference between Map and plain objects? Intermediate 70. What is the difference between Map/Set and WeakMap/WeakSet? Advanced 71. What is prototypal inheritance? Advanced 72. What is the difference between function declarations and expressions? Intermediate 73. What is an Immediately Invoked Function Expression (IIFE)? Intermediate 74. What is the rest parameter? Intermediate 75. What is the difference between parameters and arguments? Beginner 76. What are default parameters? Beginner 77. What is function scope and block scope? Intermediate 78. What is the temporal dead zone? Advanced 79. What is a generator function? Advanced 80. What is the difference between slice and splice? Intermediate 81. What are the differences between for, forEach, and map? Intermediate 82. What is the filter method? Beginner 83. What is the find method? Beginner 84. What is the difference between findIndex and indexOf? Intermediate 85. What is the includes method? Beginner 86. What is method chaining? Intermediate 87. What is a pure function? Advanced 88. What are side effects in JavaScript? Intermediate 89. What is immutability? Intermediate 90. What is composition in JavaScript? Advanced 91. What is the difference between mouseenter and mouseover? Intermediate 92. What is preventDefault and stopPropagation? Intermediate 93. What is the typeof operator? Beginner 94. What is the instanceof operator? Intermediate 95. What is NaN and how do you check for it? Intermediate 96. What is type coercion? Intermediate 97. What are truthy and falsy values? Beginner 98. What is the ternary operator? Beginner 99. What is optional chaining? Intermediate 100. What is nullish coalescing? Intermediate 101. What are logical operators beyond AND, OR, NOT? Advanced 102. What is Symbol in JavaScript? Advanced 103. What is BigInt? Intermediate 104. What are WeakMap and WeakSet use cases? Advanced 105. What is the Proxy object? Advanced 106. What is the Reflect API? Advanced 107. What are JavaScript accessors (getters and setters)? Intermediate 108. What are the differences between mutable and immutable objects? Intermediate