JavaScript — Zero to Hero

A comprehensive, code-first JavaScript curriculum for mid-level developers advancing to senior roles. Every chapter is packed with production-grade examples, anti-patterns, edge cases, and gotchas that experienced engineers encounter in real codebases.

How to Use This Course

  1. Read sequentially if you're new to a topic — chapters build on each other
  2. Jump to any chapter if you're reviewing — each is self-contained
  3. Run the examples in a browser console, Node.js REPL, or an editor
  4. Check the Quick Quiz at the end of each chapter — if you can answer it, you understand the core concept
  5. Watch for ⚠️ Edge Cases — these are the gotchas that bite in production

Prerequisites

  • Basic programming familiarity (any language)
  • A modern browser or Node.js 20+
  • An editor with syntax highlighting (VS Code recommended)

Curriculum

#TopicWhy It Matters
01Introduction & SetupEngine architecture, JIT compilation, event loop, memory model — the foundation for understanding all JS behavior
02Variables & Data TypesTDZ, type coercion, IEEE 754 floats, BigInt — avoid silent bugs from coercion and floating-point
03Operators & ExpressionsCoercion algorithm, bitwise 32-bit, short-circuit evaluation — master the rules that govern every expression
04Control FlowTruthiness, switch fall-through, finally trap, retry backoff — write correct conditionals and loops
05Functions & ScopeHoisting, arrow this, arguments, IIFE, default param TDZ — the building blocks of all JS code
06Strings & Template LiteralsUTF-16, surrogate pairs, tagged templates, normalization — handle text correctly across all Unicode
07Objects & PropertiesDescriptors, prototype chain, freeze, Proxy immutability — master the object model
08Arrays & Array MethodsHoles vs undefined, mutation methods, reduce, typed arrays — avoid array pitfalls
09Destructuring & SpreadPattern matching, null trap, safe defaults — write concise and safe data extraction
10Classes & PrototypesPrototypal inheritance, #private, static blocks, mixins — OOP in JS done right
11The this KeywordFour binding rules, arrow lexical, call/apply/bind internals — the most misunderstood keyword
12Closures & Lexical ScopeLexical environment, loop bug, memory leaks, debounce — master closures for functional patterns
13Higher-Order Functionsmap/filter/reduce, compose/pipe, curry, point-free, validators — the foundation of functional JS
14ModulesESM 3 phases, live bindings, CommonJS, dynamic import, circular deps — organize code at scale
15Callbacks & Event LoopMicrotask/macrotask, queueMicrotask, blocking, starvation — understand execution order
16PromisesState machine, chaining, all/race/allSettled/any, error propagation — modern async foundation
17Async/AwaitDesugaring to Promises, sequential vs concurrent, top-level await — write clean async code
18Error HandlingError internals, custom hierarchy, async errors, global handlers — robust error strategies
19The DOMSelection, live collections, DocumentFragment, MutationObserver, Shadow DOM — manipulate the page efficiently
20EventsCapture/bubble, delegation, stopPropagation, CustomEvent, passive listeners — master browser events
21Web Storage & APIslocalStorage, IndexedDB, Fetch streaming, Cache API — persist data and communicate with servers
22Timers & SchedulingsetTimeout drift, rAF, debounce/throttle implementations — control when code runs
23Functional ProgrammingPure functions, immutability, Either monad, Redux reducer — write predictable, testable code
24Design PatternsModule, Observer/Pub-Sub, Strategy, State Machine, Builder — proven solutions to common problems
25TestingVitest, vi.mock/vi.fn, DI for testability, TDD, snapshot testing — ensure correctness and prevent regressions
26Performance & OptimizationV8 hidden classes, closure leaks, benchmarking, lazy evaluation — make JS fast and memory-efficient
27Tooling & Build Systemsnpm/pnpm, ESLint, Vite, tree-shaking, source maps — configure the modern JS toolchain
28TypeScript EssentialsStructural typing, generics, conditional types, utility types, declaration files — add type safety to JS
29SecurityXSS, CSRF, CSP, prototype pollution, input validation — protect against common web vulnerabilities
30Exercises & ProjectsState store, API client, virtual DOM, WebSocket chat, utilities — build production systems from scratch

Track Overview

Part I: Foundations (01–10)

Language fundamentals — types, scope, objects, arrays, classes. Master these before moving to async or browser topics.

Part II: Async & Control (11–18)

Closures, higher-order functions, modules, the event loop, Promises, async/await, and error handling. The core of modern JavaScript.

Part III: Browser & APIs (19–22)

DOM manipulation, events, storage, network requests, and timers. Everything you need to build client-side applications.

Part IV: Architecture (23–25)

Functional programming, design patterns, and testing. Write maintainable, testable code at scale.

Part V: Production (26–30)

Performance, tooling, TypeScript, security, and capstone projects. The skills that distinguish senior engineers.