Complete JavaScript Interview Notes
1. Variables
Variables store data values. JavaScript provides var, let, and const.
2. Scope
Global, Function, and Block scope determine variable accessibility.
3. Hoisting
Variable and function declarations are moved to the top of their scope during compilation.
4. Closures
A closure allows a function to access variables from its outer scope even after the outer function
has executed.
5. Data Types
Primitive: String, Number, Boolean, Undefined, Null, Symbol, BigInt. Non-primitive: Object.
6. Arrays
Ordered collections with methods like map, filter, reduce, find, and forEach.
7. Objects
Key-value collections used to model real-world entities.
8. Functions
Reusable blocks of code. Includes regular, anonymous, and arrow functions.
9. DOM
Document Object Model allows JavaScript to manipulate HTML elements.
10. Events
User interactions such as click, keypress, and submit.
11. Event Bubbling
Events propagate from child to parent elements.
12. Event Capturing
Events propagate from parent to child elements.
13. Promises
Handle asynchronous operations with pending, fulfilled, and rejected states.
14. Async/Await
Cleaner syntax for working with promises.
15. Event Loop
JavaScript mechanism for handling asynchronous operations.
16. ES6 Features
let, const, arrow functions, template literals, destructuring, spread operator, modules.
17. OOP Concepts
Encapsulation, Inheritance, Polymorphism, and Abstraction.
18. Modules
Export and import code across files.
19. Error Handling
try, catch, finally, and throw.
20. Memory Management
Garbage collection automatically frees unused memory.
50 JavaScript Interview Questions
1. What is JavaScript?
2. What are primitive data types?
3. Difference between var, let, and const?
4. What is hoisting?
5. What is a closure?
6. What is scope?
7. Difference between null and undefined?
8. Difference between == and ===?
9. What is typeof?
10. What is NaN?
11. What is the DOM?
12. What is event bubbling?
13. What is event capturing?
14. What is event delegation?
15. What are callbacks?
16. What are promises?
17. What is async/await?
18. What is the event loop?
19. What is a higher-order function?
20. What is a pure function?
21. What is currying?
22. What is memoization?
23. What is destructuring?
24. What is the spread operator?
25. What is the rest operator?
26. What is optional chaining?
27. What is localStorage?
28. What is sessionStorage?
29. What are cookies?
30. What is JSON?
31. Difference between map and forEach?
32. Difference between filter and find?
33. Difference between slice and splice?
34. What is reduce?
35. What is an IIFE?
36. What is strict mode?
37. What are arrow functions?
38. What is this keyword?
39. Difference between call, apply, bind?
40. What is prototype?
41. What is prototypal inheritance?
42. What is class in JavaScript?
43. What is encapsulation?
44. What is inheritance?
45. What is polymorphism?
46. What is abstraction?
47. What is debouncing?
48. What is throttling?
49. How does garbage collection work?
50. What are JavaScript modules?