JavaScript Complete Notes + Cheatsheet +
Interview Questions
1. JavaScript Basics
• JS is a high-level, interpreted scripting language.
• Used for frontend, backend ([Link]), and full-stack development.
2. Data Types
• Primitive: Number, String, Boolean, Undefined, Null, BigInt, Symbol (Immutable)
• Non-Primitive: Object, Array, Function (Mutable)
3. var vs let vs const
• var → Function scope, can redeclare & reassign
• let → Block scope, cannot redeclare
• const → Block scope, cannot redeclare or reassign
4. Hoisting & TDZ
• Hoisting moves declarations to top.
• var initialized as undefined.
• let & const stay in Temporal Dead Zone until initialized.
5. Functions
• Named Function
• Anonymous Function
• Function Expression
• Arrow Function
• IIFE
• Higher Order Function
6. Arrays Important Methods
• push(), pop(), shift(), unshift()
• map(), filter(), reduce()
• find(), findIndex()
7. Objects
• CRUD operations
• [Link](), [Link](), [Link]()
• Destructuring
8. Promises & Async/Await
• Promise states: pending, fulfilled, rejected
• Methods: then(), catch(), finally()
• async/await simplifies promise handling
JavaScript Quick Cheatsheet
• Strict Equality: === (value + type)
• Arrow Function: const sum = (a,b) => a+b
• Destructuring: const {name} = obj
• Spread: const arr2 = [...arr1]
• Rest: function demo(...args)
• Array Map: [Link](ele => ele*2)
• Filter: [Link](ele => ele>10)
• Reduce: [Link]((acc,ele)=>acc+ele,0)
• JSON: [Link]() / [Link]()
Short Interview Questions
• 1. Difference between var, let, and const?
• 2. What is hoisting in JavaScript?
• 3. What is closure?
• 4. Difference between == and ===?
• 5. What is a Higher Order Function?
• 6. Explain map vs filter vs reduce.
• 7. What is the difference between null and undefined?
• 8. What is event loop in JavaScript?
• 9. What is the difference between synchronous and asynchronous code?
• 10. What is the purpose of async/await?