JavaScript & TypeScript
Event loop, async/await, Node & browser internals, TypeScript types, DOM & web security.
Chapter 1: V8 Execution Model, Call Stack & Heap
How V8 parses JavaScript into bytecode and JIT-compiled machine code, manages execution frames on the call stack, optimizes object hidden classes, and collects heap garbage.
Chapter 2: Scope, Closures, Hoisting & Lexical Environments
How JavaScript resolves variable names statically at author time via lexical environment chains, why `let`/`const` eliminate `var` bugs, and how closures capture state cleanly.
Chapter 3: Objects, Prototypes, `this` Binding & Classes
Mastering JavaScript's prototype delegation chain, the four rules that govern `this`, property descriptors, private class fields (`#`), and when to pick `Map`/`Set` over plain objects.
Chapter 4: The Event Loop, Microtasks, Macrotasks & Timers
Understanding non-blocking concurrency on a single JavaScript thread: call stack draining, microtask checkpoints, macrotask queues, libuv phases, and preventing event-loop lag.
Chapter 5: Promises, `async`/`await`, Error Propagation & Cancellation
Mastering Promise state machines, concurrency combinators, `async`/`await` pitfalls, structured error propagation, bounded concurrency, and cooperative cancellation with `AbortController`.
Chapter 6: Modules (ESM vs CommonJS), Bundlers & Package Security
Comparing static ES Modules against legacy CommonJS, understanding `package.json` resolution and tree-shaking, and defending Node/JS apps against npm supply-chain attacks.
Chapter 7: Node.js Runtime, Streams, Buffers & Child Processes
Handling raw binary `Buffer` memory safely, streaming gigabytes in constant RAM with backpressure and `stream.pipeline`, safe `fs/promises` I/O, and injection-proof child process execution.
Chapter 8: TypeScript Type System Foundations
Understanding TypeScript as a compile-time structural type checker erased at runtime: `unknown` vs. `any`, discriminated unions, control-flow narrowing, and exhaustive `never` checks.
Chapter 9: Generics, Utility Types, Conditional & Mapped Types
Writing reusable type-safe abstractions with constrained generics, `keyof` lookups, built-in utility types, mapped/conditional types, template literal types, and the `satisfies` operator.
Chapter 10: Type-Safe APIs, Runtime Validation & Strict Compiler Config
Bridging compile-time TypeScript with untrusted runtime payloads: schema validation at system boundaries, strict `tsconfig.json` flags, error-as-value `Result` patterns, and clean module builds.
Chapter 11: Browser DOM, Events, Rendering Pipeline & Fetch/CORS
Understanding the browser's critical rendering pipeline, DOM event bubbling and delegation, avoiding layout thrashing, and mastering `fetch()`, CORS preflights, and browser storage boundaries.
Chapter 12: Web Security Fundamentals (XSS, CSRF, CSP & Prototype Pollution)
Defending JavaScript and TypeScript web applications against real-world exploits: XSS sinks, Prototype Pollution, CSRF/SameSite cookies, Content Security Policy, ReDoS, and safe auth crypto.
Chapter 13: Testing, Profiling & Memory Leak Hunting in JS/TS
Writing fast zero-dependency tests with `node:test`, deterministic time/dependency injection, CPU flamegraph profiling, V8 heap snapshot comparison, and diagnosing production leaks.
Chapter 14: End-to-End Production Architecture (Zero-Dep CLI & HTTP Patterns)
Putting all 13 chapters together into clean, zero-dependency production JavaScript & TypeScript patterns: layered architecture, resilient HTTP handlers, streaming pipelines, graceful shutdown, and a shipping checklist.