4.1 Core JavaScript
Variables: let (block-scoped, reassignable), const (block-scoped, not reassignable), never var (function-scoped, hoisted — legacy). Data types: string, number, boolean, null, undefined, symbol, bigint. Type coercion: == vs === (always use ===). Template literals: `Hello ${name}`. Operators: arithmetic, comparison, logical, nullish coalescing (??), optional chaining (?.). Control flow: if/else, switch, ternary. Loops: for, for...of (arrays), for...in (objects).
4.2 Functions & Scope
Function declaration vs expression vs arrow function. Parameters: default values, rest (...args), destructuring. Return values. Scope: block, function, global. Closures: function that "remembers" its outer scope (used in event handlers, React hooks, module patterns). IIFE (Immediately Invoked Function Expression). Higher-order functions: functions that take/return functions. this keyword: how context changes with arrow vs regular functions (the #1 JS interview question).
4.3 Arrays, Objects & Modern Methods
Array methods: map (transform), filter (select), reduce (accumulate), find, findIndex, some, every, flat, flatMap, includes. Object methods: Object.keys(), values(), entries(), spread (...obj), Object.assign(). Destructuring: const {name, age} = person; const [first, ...rest] = arr. JSON: parse, stringify. Immutability: never mutate arrays/objects directly (spread creates new copy). These methods are used in EVERY React component — mastering them is the prerequisite for React.
4.4 DOM Manipulation & Events
Selecting elements: querySelector, querySelectorAll (modern), getElementById (legacy). Modifying: textContent, innerHTML, classList.add/remove/toggle, setAttribute, style. Creating elements: createElement, appendChild, insertAdjacentHTML. Events: addEventListener (click, submit, input, keydown, scroll). Event delegation: attach one listener to parent instead of many to children. Event object: e.target, e.preventDefault(), e.stopPropagation(). DOM manipulation is what makes web pages INTERACTIVE.
4.5 Asynchronous JavaScript
Callbacks: function passed to another function (the old way — leads to "callback hell"). Promises: .then().catch().finally() — cleaner async chaining. async/await: const data = await fetch(url) — synchronous-looking async code (the modern standard). Error handling: try/catch with async/await. Promise.all (parallel), Promise.race (first resolved). The event loop: call stack → web APIs → callback queue → microtask queue. Understanding async is ESSENTIAL — every API call, every database query, every timer is async.
4.6 Modules, Classes & Modern Features
ES Modules: import/export (named and default). Dynamic import: import() for code splitting. Classes: constructor, methods, inheritance (extends, super), static methods, private fields (#). Iterators and generators (yield). Map, Set, WeakMap, WeakSet. Proxy and Reflect (advanced). Structured clone for deep copying. Optional chaining (?.) and nullish coalescing (??) — the two operators that make every codebase cleaner.
Placement relevance: JavaScript is the #1 most-used programming language (Stack Overflow 2024). "Explain closures," "How does the event loop work," "Difference between == and ===" — the top 3 JS interview questions at every company. Array methods (map, filter, reduce) are used in every React component. async/await is used in every API call. JavaScript mastery determines frontend AND MERN full-stack interview performance.