# π¨ JavaScript β Complete Topics List (Zero Chhoot, Zero Mercy)
π Ek ek topic padh, ek ek samajh. Skip kiya toh pachtayega!
# π¦ SECTION 1 β Fundamentals (Basics ki Jad)
# 1.1 Introduction
- What is JavaScript?
- History & Evolution (ES5 β ES6+ β ESNext)
- How JS runs in Browser vs Node.js
- JS Engine (V8, SpiderMonkey) & Runtime
- Call Stack, Heap Memory
- Single-threaded nature of JS
# 1.2 Script Setup
<script>tag β inline vs externaldeferandasyncattributes- Browser Console & DevTools
# π€ SECTION 2 β Variables & Data Types
# 2.1 Variable Declarations
varβ function scoped, hoistedletβ block scopedconstβ block scoped, immutable binding- Differences & Best Practices
- Temporal Dead Zone (TDZ)
# 2.2 Data Types
- Primitives:
Number(includingNaN,Infinity)StringBooleanundefinednullSymbol(ES6)BigInt(ES2020)
- Non-Primitives (Reference Types):
ObjectArrayFunction
# 2.3 Type System
typeofoperator- Type Coercion (Implicit vs Explicit)
==vs===- Truthy & Falsy values
nullvsundefinedvsNaN
# π’ SECTION 3 β Operators
- Arithmetic Operators (
+,-,*,/,%,**) - Assignment Operators (
=,+=,-=, etc.) - Comparison Operators (
==,!=,===,!==,>,<,>=,<=) - Logical Operators (
&&,||,!) - Nullish Coalescing (
??) - Optional Chaining (
?.) - Ternary Operator (
condition ? a : b) - Bitwise Operators (
&,|,^,~,<<,>>,>>>) - Comma Operator
inoperatorinstanceofoperator- Spread (
...) and Rest (...) operators voidoperatordeleteoperatortypeofoperator
# π SECTION 4 β Control Flow
# 4.1 Conditionals
if,else if,elseswitchstatement- Guard Clauses Pattern
# 4.2 Loops
forloopwhileloopdo...whileloopfor...inloop (object keys)for...ofloop (iterables)breakandcontinue- Labeled Statements
# π§© SECTION 5 β Functions
# 5.1 Types of Functions
- Function Declaration
- Function Expression
- Arrow Functions (
=>) - Anonymous Functions
- Named Function Expressions
- IIFE (Immediately Invoked Function Expression)
- Generator Functions (
function*) - Async Functions (
async function)
# 5.2 Function Concepts
- Parameters vs Arguments
- Default Parameters
- Rest Parameters (
...args) - Arguments Object
- Return Values
- First-Class Functions
- Higher-Order Functions
- Pure Functions
- Function Composition
# 5.3 Advanced Function Topics
- Closures
- Lexical Scope
- Scope Chain
thiskeywordcall(),apply(),bind()- Currying
- Memoization
- Recursion
- Tail Call Optimization
# ποΈ SECTION 6 β Scope & Hoisting
- Global Scope
- Function Scope
- Block Scope
- Lexical Scope
- Scope Chain
- Variable Hoisting (
var) - Function Hoisting
- Temporal Dead Zone (
let,const) - Module Scope
# π§ SECTION 7 β Objects
# 7.1 Object Basics
- Object Literals
- Property Access (dot vs bracket notation)
- Property Shorthand (ES6)
- Computed Property Names
- Property Descriptors (
writable,enumerable,configurable) Object.defineProperty()
# 7.2 Object Methods (Built-in)
Object.keys(),Object.values(),Object.entries()Object.assign()Object.freeze(),Object.seal()Object.create()Object.getPrototypeOf()Object.fromEntries()hasOwnProperty()
# 7.3 Advanced Object Concepts
- Prototype & Prototype Chain
__proto__vsprototype- Prototypal Inheritance
- Object Destructuring
- Spread in Objects (
...) - Getter & Setter (
get,set) - Symbol as Object Key
- Proxy & Reflect (ES6)
# π SECTION 8 β Arrays
# 8.1 Array Basics
- Array Creation (literal,
Array(),Array.from(),Array.of()) - Indexing & Length
- Multidimensional Arrays
# 8.2 Array Methods β Mutating
push(),pop()shift(),unshift()splice()reverse()sort()fill()copyWithin()
# 8.3 Array Methods β Non-Mutating
slice()concat()join()indexOf(),lastIndexOf()includes()find(),findIndex()flat(),flatMap()toString()
# 8.4 Higher-Order Array Methods
map()filter()reduce(),reduceRight()forEach()every(),some()
# 8.5 Static Array Methods
Array.isArray()Array.from()Array.of()
# 8.6 Array Destructuring
- Basic Destructuring
- Skipping Elements
- Rest in Destructuring
- Swap Variables
# π§΅ SECTION 9 β Strings
# 9.1 String Basics
- String Creation (literal,
String(), backticks) - Immutability of Strings
- String Indexing
lengthproperty
# 9.2 Template Literals
- Interpolation (
${}) - Multiline Strings
- Tagged Templates
# 9.3 String Methods
charAt(),charCodeAt()indexOf(),lastIndexOf()includes(),startsWith(),endsWith()slice(),substring(),substr()(deprecated)toUpperCase(),toLowerCase()trim(),trimStart(),trimEnd()padStart(),padEnd()repeat()replace(),replaceAll()split()match(),matchAll()search()at()String.fromCharCode()normalize()
# π’ SECTION 10 β Numbers & Math
# 10.1 Number
Number()conversionparseInt(),parseFloat()isNaN(),Number.isNaN()isFinite(),Number.isFinite()isInteger(),isSafeInteger()toFixed(),toPrecision(),toString()Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGERNumber.EPSILONInfinity,-InfinityNaNbehavior- Binary (
0b), Octal (0o), Hex (0x) literals
# 10.2 Math Object
Math.abs(),Math.ceil(),Math.floor(),Math.round()Math.max(),Math.min()Math.pow(),Math.sqrt(),Math.cbrt()Math.random()Math.trunc(),Math.sign()Math.log(),Math.log2(),Math.log10()Math.PI,Math.EMath.sin(),Math.cos(),Math.tan()
# 10.3 BigInt
- BigInt literals (
42n) - BigInt operations
- Limitations of BigInt
# π SECTION 11 β Date & Time
new Date()- Date Methods:
getFullYear(),getMonth(),getDate(),getDay() getTime(),Date.now()setFullYear(),setMonth(), etc.toISOString(),toLocaleDateString(),toLocaleTimeString()- Date Arithmetic
- Timezone concepts
- Libraries:
date-fns,Day.js,Luxon(mention only)
# βοΈ SECTION 12 β Regular Expressions (Regex)
- Regex Syntax (
/pattern/flags) - Flags:
g,i,m,s,u,y - Character Classes (
\d,\w,\s,[a-z], etc.) - Anchors (
^,$,\b) - Quantifiers (
*,+,?,{n},{n,m}) - Groups: Capturing
(), Non-capturing(?:), Named(?<name>) - Lookaheads & Lookbehinds
- Backreferences
- Methods:
test(),exec(),match(),matchAll(),replace(),search(),split()
# β‘ SECTION 13 β Error Handling
try...catch...finallythrowstatement- Error Types:
Error,TypeError,ReferenceError,SyntaxError,RangeError,URIError,EvalError - Custom Error Classes
- Error Properties:
message,name,stack - Async Error Handling
- Global Error Handling:
window.onerror,unhandledrejection
# π SECTION 14 β Asynchronous JavaScript (Most Important!)
# 14.1 Concurrency Model
- JS Event Loop (Deep Dive)
- Call Stack
- Web APIs
- Callback Queue (Macrotask Queue)
- Microtask Queue
- Task Prioritization
# 14.2 Callbacks
- Callback Pattern
- Callback Hell / Pyramid of Doom
- Error-first Callbacks (Node.js style)
# 14.3 Promises
- Creating Promises (
new Promise()) .then(),.catch(),.finally()- Promise States: Pending, Fulfilled, Rejected
- Promise Chaining
Promise.all()Promise.allSettled()Promise.race()Promise.any()Promise.resolve(),Promise.reject()
# 14.4 Async/Await
asyncfunctionawaitkeyword- Error handling with
try/catch - Sequential vs Parallel execution
awaitwithPromise.all()- Top-level
await(ES2022)
# 14.5 Timers
setTimeout(),clearTimeout()setInterval(),clearInterval()queueMicrotask()requestAnimationFrame()setImmediate()(Node.js)process.nextTick()(Node.js)
# π SECTION 15 β Web APIs (Browser JS)
# 15.1 DOM (Document Object Model)
- DOM Tree Structure
documentobject- Selecting Elements:
getElementById(),getElementsByClassName(),getElementsByTagName()querySelector(),querySelectorAll()
- Traversing DOM:
parentNode,parentElementchildNodes,childrenfirstChild,lastChild,firstElementChild,lastElementChildnextSibling,previousSibling,nextElementSibling,previousElementSibling
- Manipulating DOM:
innerHTML,textContent,innerTextcreateElement(),createTextNode()appendChild(),insertBefore(),append(),prepend()insertAdjacentHTML(),insertAdjacentElement()removeChild(),remove()replaceChild(),replaceWith()cloneNode()
- Attributes:
getAttribute(),setAttribute(),removeAttribute(),hasAttribute() dataset(data attributes)classList:add(),remove(),toggle(),contains(),replace()- Inline Styles:
element.style getComputedStyle()
# 15.2 Events
- Event Listeners:
addEventListener(),removeEventListener() - Event Object Properties:
target,currentTarget,type,preventDefault(),stopPropagation(),stopImmediatePropagation() - Event Bubbling & Capturing
- Event Delegation
- Common Events:
- Mouse:
click,dblclick,mousedown,mouseup,mousemove,mouseenter,mouseleave,mouseover,mouseout,contextmenu - Keyboard:
keydown,keyup,keypress - Form:
submit,change,input,focus,blur,reset - Window:
load,DOMContentLoaded,resize,scroll,unload,beforeunload - Drag:
dragstart,drag,dragend,dragover,drop,dragenter,dragleave - Touch:
touchstart,touchmove,touchend - Clipboard:
copy,cut,paste
- Mouse:
- Custom Events (
CustomEvent) once,capture,passiveoptions
# 15.3 BOM (Browser Object Model)
windowobjectnavigatorobject (userAgent, geolocation, etc.)locationobject (href, reload, replace, assign)historyobject (back, forward, pushState, replaceState)screenobjectalert(),confirm(),prompt()scrollTo(),scrollBy()open(),close()
# 15.4 Storage
localStorage(persistent)sessionStorage(session-based)cookies(document.cookie)IndexedDB(client-side DB)Cache API
# 15.5 Fetch API & AJAX
XMLHttpRequest(legacy AJAX)fetch()API- Request & Response Objects
- Headers
- HTTP Methods: GET, POST, PUT, PATCH, DELETE
- Handling JSON
AbortController(cancel fetch)- CORS (Cross-Origin Resource Sharing)
# 15.6 Other Web APIs
Geolocation APINotification APIClipboard APIFile API&FileReaderCanvas APIWebSocketsServer-Sent Events (SSE)Web WorkersService Workers& PWAIntersectionObserverMutationObserverResizeObserverBroadcast Channel APICrypto API(crypto.randomUUID())
# π§± SECTION 16 β Object-Oriented Programming (OOP)
# 16.1 Constructor Functions
newkeyword- Constructor Pattern
instanceofcheck
# 16.2 Prototype-based Inheritance
prototypeproperty- Prototype Chain
- Inheriting methods via prototype
# 16.3 ES6 Classes
classkeywordconstructor()- Instance Methods
- Static Methods & Properties (
static) - Getters & Setters
extends(Inheritance)superkeyword- Method Overriding
- Private Fields (
#field) - Private Methods
- Abstract Class Pattern
# 16.4 OOP Principles in JS
- Encapsulation
- Abstraction
- Inheritance
- Polymorphism
# 𧬠SECTION 17 β Functional Programming (FP)
- Pure Functions
- Immutability
- Function Composition (
compose,pipe) - Higher-Order Functions
- Currying & Partial Application
- Functors & Monads (basic concept)
map,filter,reduceas FP pillars- Avoiding Side Effects
- Declarative vs Imperative style
# π¦ SECTION 18 β ES6+ Modern JavaScript Features
# ES6 (2015)
let,const- Arrow Functions
- Template Literals
- Destructuring (Array & Object)
- Default Parameters
- Rest & Spread Operators
- Classes
- Modules (
import/export) - Promises
- Symbols
- Iterators & Iterables (
[Symbol.iterator]) - Generators (
function*,yield) MapandSetWeakMapandWeakSetProxyandReflectfor...ofloop- Computed Property Names
# ES2017 (ES8)
async/awaitObject.entries(),Object.values()String.prototype.padStart(),padEnd()- Trailing commas in function params
# ES2018 (ES9)
- Async Iteration (
for await...of) Promise.finally()- Object Rest/Spread
- Regex improvements
# ES2019 (ES10)
Array.prototype.flat(),flatMap()Object.fromEntries()String.prototype.trimStart(),trimEnd()- Optional
catchbinding
# ES2020 (ES11)
BigIntPromise.allSettled()String.prototype.matchAll()- Optional Chaining (
?.) - Nullish Coalescing (
??) globalThis- Dynamic Import (
import())
# ES2021 (ES12)
String.prototype.replaceAll()Promise.any()- Logical Assignment Operators (
&&=,||=,??=) WeakRef&FinalizationRegistry- Numeric Separators (
1_000_000)
# ES2022 (ES13)
- Class Fields (Public & Private)
- Static Class Fields & Methods
- Top-level
await Array.prototype.at()Object.hasOwn()Error.cause/.dflag for Regex
# ES2023 (ES14)
Array.prototype.toSorted(),toReversed(),toSpliced(),with()findLast(),findLastIndex()- Hashbang Grammar
# ES2024 (ES15)
Promise.withResolvers()Object.groupBy(),Map.groupBy()ArrayBuffer.prototype.resize()- RegExp
vflag
# ποΈ SECTION 19 β Modules
- CommonJS (
require,module.exports) β Node.js - ES Modules (
import,export) β Modern Standard - Named vs Default exports
export * from- Dynamic Imports (
import()) - Module Bundlers: Webpack, Vite, Rollup, esbuild
- Tree Shaking
- Circular Dependencies
# π SECTION 20 β Iterators & Generators
- Iterator Protocol (
next(),value,done) - Iterable Protocol (
[Symbol.iterator]) - Custom Iterables
- Generator Functions (
function*) yield&yield*- Infinite Sequences
return()andthrow()on generators- Async Generators (
async function*) for await...ofwith async generators
# πΊοΈ SECTION 21 β Map, Set, WeakMap, WeakSet
# Map
new Map()set(),get(),has(),delete(),clear()sizeproperty- Iterating Map (
forEach,for...of,.keys(),.values(),.entries()) - Map vs Object differences
# Set
new Set()add(),has(),delete(),clear()sizeproperty- Iterating Set
- Set for deduplication
- Set operations (Union, Intersection, Difference)
# WeakMap & WeakSet
- Weak references
- No iteration
- Use cases (private data, caching)
- Garbage collection behavior
# π§΅ SECTION 22 β Symbol
Symbol()β unique primitivesSymbol.for()&Symbol.keyFor()- Well-known Symbols:
Symbol.iteratorSymbol.toPrimitiveSymbol.toStringTagSymbol.hasInstanceSymbol.asyncIteratorSymbol.species
- Symbols as private object keys
# π‘οΈ SECTION 23 β Proxy & Reflect
# Proxy
new Proxy(target, handler)- Traps:
get,set,has,deleteProperty,apply,construct,ownKeys, etc. - Use cases: validation, logging, reactive data
# Reflect
Reflect.get(),Reflect.set(),Reflect.has(), etc.- Reflect as complement to Proxy
# π SECTION 24 β Memory Management & Performance
- Garbage Collection (Mark & Sweep)
- Memory Leaks (causes & prevention)
- WeakRef & FinalizationRegistry
- Object Pooling
- Debouncing & Throttling
- Lazy Loading
- Code Splitting
requestAnimationFramefor animationsrequestIdleCallback- Profiling with DevTools
# π§ͺ SECTION 25 β Testing in JavaScript
- Unit Testing, Integration Testing, E2E Testing
- Test Runners: Jest, Vitest, Mocha
- Assertion Libraries: Chai, built-in
assert - Mocking:
jest.fn(),jest.mock() - Spies & Stubs
- Testing Library (for DOM testing)
- Cypress / Playwright (E2E)
- Code Coverage
- TDD (Test-Driven Development)
# ποΈ SECTION 26 β Design Patterns in JavaScript
# Creational Patterns
- Factory Pattern
- Constructor Pattern
- Singleton Pattern
- Prototype Pattern
- Builder Pattern
# Structural Patterns
- Module Pattern
- Revealing Module Pattern
- Decorator Pattern
- Facade Pattern
- Adapter Pattern
- Mixin Pattern
# Behavioral Patterns
- Observer Pattern / Pub-Sub
- Command Pattern
- Strategy Pattern
- Iterator Pattern
- Mediator Pattern
- Chain of Responsibility
# π₯οΈ SECTION 27 β Node.js Specific (Backend JS)
- Node.js Architecture & Event Loop differences
processobjectBufferand Streams- File System (
fsmodule) - Path module (
path) - HTTP module
- EventEmitter
- Modules: CommonJS vs ESM
- NPM / PNPM / Yarn
package.json&package-lock.json- Environment Variables (
.env,dotenv) - Child Processes
- Cluster module
- Worker Threads
- REPL
# π SECTION 28 β Security in JavaScript
- XSS (Cross-Site Scripting) β prevention
- CSRF (Cross-Site Request Forgery) β prevention
- Content Security Policy (CSP)
eval()β dangers- Prototype Pollution
- Sanitizing user input
- CORS security
- Secure cookies (
HttpOnly,Secure,SameSite) - JWT basics
- HTTPS
# π§° SECTION 29 β Tools & Ecosystem
# Code Quality
- ESLint (linting)
- Prettier (formatting)
- Husky + lint-staged (pre-commit hooks)
- TypeScript (static typing)
# Build Tools
- Webpack
- Vite
- Rollup
- esbuild
- Parcel
- Babel (transpiling)
# Package Managers
- npm
- yarn
- pnpm
# Version Control
- Git basics (not JS but must-know)
# Runtime Environments
- Browser
- Node.js
- Deno
- Bun
# π SECTION 30 β TypeScript (Extension of JS)
- Why TypeScript?
- Basic Types:
string,number,boolean,any,unknown,never,void - Type Annotations & Type Inference
- Interfaces vs Types
- Generics
- Union & Intersection Types
- Enums
- Tuple Types
- Optional & Readonly Properties
- Type Narrowing & Guards
- Utility Types:
Partial,Required,Readonly,Record,Pick,Omit,Exclude,Extract,ReturnType,Parameters tsconfig.json- Declaration Files (
.d.ts) - Decorators (experimental)
# π§ SECTION 31 β Deep Dive / Internals
- JS Engine Internals (Parsing, AST, Bytecode, JIT)
- V8 Optimization (Hidden Classes, Inline Caching)
- Execution Context & Execution Context Stack
- Variable Environment vs Lexical Environment
thisbinding rules:- Default binding
- Implicit binding
- Explicit binding
newbinding- Arrow function (no
this)
argumentsobject vs rest params- Strict Mode (
"use strict") - Tail Call Optimization (TCO)
- Coercion internals (
ToPrimitive,ToString,ToNumber,ToBoolean)
# π SECTION 32 β Internationalization (i18n)
IntlobjectIntl.NumberFormatIntl.DateTimeFormatIntl.CollatorIntl.PluralRulesIntl.RelativeTimeFormatIntl.Segmenter
# β¨ SECTION 33 β Miscellaneous (Chhota Par Zaroori)
- JSON:
JSON.parse(),JSON.stringify(), replacer, reviver, spacing structuredClone()(deep copy)- Shallow vs Deep Copy
Object.assign()vs spread for copy- Serialization / Deserialization
eval()(why to avoid)withstatement (deprecated, don't use)- Comma operator
- Labeled statements
voidoperatortypeof null === "object"bug (historical)NaN !== NaNquirk0 === -0butObject.is(0, -0)isfalse
# π― SECTION 34 β Interview Prep Topics
- Polyfills:
map,filter,reduce,bind,call,apply,Promise,flat - Output-based questions (type coercion, hoisting, closures)
- Event Loop output questions
thisbinding tricky questions- Closure interview questions
- Debounce & Throttle implementation
- Deep clone implementation
- Currying implementation
- Compose/Pipe implementation
- Infinite currying (
add(1)(2)(3)...) - Promises from scratch
- Custom
Promise.all() - LRU Cache in JS
- Flatten nested array/object
- Implement
newoperator - Implement
instanceof - Memoization from scratch
π₯ Extra Gyan By Your Bhai:
Bhai sun, JS sikhna ek baar ki baat nahi hai. Yeh layered hai:
Layer 1 β Syntax (Sections 1β13)
Layer 2 β Async (Section 14 β sabse important, yahan log phaste hain)
Layer 3 β Browser/Web APIs (Section 15)
Layer 4 β OOP/FP (Sections 16β17)
Layer 5 β Modern JS + Internals (Sections 18β33)
Layer 6 β Ecosystem + TypeScript (Sections 29β30)Sequence follow kar. Async ko skip mat karna sochke "baad mein kar lunga" β woh baad kabhi nahi aata. π€
Aur haan β JavaScript padhna aur JavaScript likhna dono alag cheez hain. Code karta reh, sirf padhta mat reh. π»
Total Sections: 34 | Total Topics: 300+ | Koi topic nahi chhoda bhai π«‘