Learn JavaScript: Free JavaScript Tutorial in 96 Lessons
Learn JavaScript free: 96 lessons in 16 modules, from first programs to interview questions, with exercises judged on Node 16 and a certificate.
- Language: JavaScript
- Runtime: Node 16
- Modules: 16
- Lessons: 96
- Reading time: about 24 hours
- Cost: Free on every plan, with a certificate
The language behind the browser and Node — values and coercion, closures and this, prototypes, the event loop, promises and async — with exercises judged on a real Node runtime.
Syllabus
Module 1: JavaScript and its runtime
What the language is and who defines it, engines and the JIT, Node as a host, reading stdin and writing exact output, statements versus expressions and ASI, strict mode, and a first look at the event loop.
- What JavaScript is, and why it looks the way it does 12 min
- Engines, runtimes and running code with Node 13 min
- Reading input and writing output in Node 13 min
- Statements, expressions and the semicolon rules 12 min
- The event loop — a first look 14 min
- Checkpoint — JavaScript and its runtime (checkpoint) 24 min
Module 2: Values, types and coercion
The seven primitives and typeof, numbers as doubles with NaN and BigInt, strings and their toolkit, truthiness and the rules behind == and +, the nullish operators, and let/const/var with the temporal dead zone.
- The seven primitives, objects and typeof 12 min
- Numbers — doubles, NaN, safe integers and BigInt 14 min
- Strings — immutable text, template literals and the method toolkit 14 min
- Truthiness, coercion and the two equalities 14 min
- let, const and var — scope, hoisting and the temporal dead zone 13 min
- Checkpoint — Values, types and coercion (checkpoint) 24 min
Module 3: Functions, scope and closures
Declarations, expressions and arrows; parameters with defaults and rest; lexical scope and hoisting; closures and their patterns; the five rules for this with call, apply and bind; higher-order functions, composition and currying.
- Declaring functions — declarations, expressions, arrows and parameters 13 min
- Lexical scope, the scope chain and hoisting 12 min
- Closures — functions that remember 14 min
- this — the five binding rules, call, apply and bind 15 min
- Higher-order functions — composition, currying and callbacks 13 min
- Checkpoint — Functions, scope and closures (checkpoint) 24 min
Module 4: Objects, arrays and destructuring
Object literals and JSON; references, shallow and deep copies, Object.freeze and immutable updates; arrays and the sort trap; the map/filter/reduce toolbox; destructuring and spread in every position.
- Object literals — properties, keys, iteration and JSON 13 min
- References, shallow and deep copies, and freezing 13 min
- Arrays — dynamic, sparse, and sorted lexically by default 13 min
- The array methods toolbox — map, filter, reduce and friends 14 min
- Destructuring and spread — taking things apart and putting them together 13 min
- Checkpoint — Objects, arrays and destructuring (checkpoint) 24 min
Module 5: Prototypes and classes
The prototype chain and delegation; constructor functions and the four steps of new; class syntax with fields, private members, accessors and statics; extends and super; property descriptors and the toString/valueOf/toJSON protocols.
- The prototype chain — how JavaScript objects inherit 13 min
- Constructor functions and what `new` really does 12 min
- Class syntax — fields, methods, statics, private and accessors 14 min
- Inheritance — extends, super, overriding and extending built-ins 13 min
- Property descriptors and the object protocols — toString, valueOf, toJSON, Symbol.toPrimitive 13 min
- Checkpoint — Prototypes and classes (checkpoint) 24 min
Module 6: Collections and iteration
Map and Set with their idioms and hand-written algebra; WeakMap, WeakSet and WeakRef; the iteration protocol behind for…of and spread; generators and lazy pipelines; symbols as unique keys and the language's hooks.
- Map and Set — real keyed collections 12 min
- WeakMap, WeakSet and WeakRef — data that does not keep objects alive 11 min
- The iteration protocol — what for…of, spread and destructuring actually call 13 min
- Generators — functions that pause, and lazy pipelines 14 min
- Symbols — unique keys and the language's extension points 11 min
- Checkpoint — Collections and iteration (checkpoint) 24 min
Module 7: Errors and error handling
throw/try/catch/finally precisely; the built-in error types and custom hierarchies with codes and cause; where to catch — boundaries, per-item recovery, retries, result objects; validation and assertions; reading stack traces and decoding the common messages.
- throw, try, catch, finally — the mechanics, precisely 12 min
- The built-in error types, and designing your own 12 min
- Where to catch — strategies, boundaries and the result-object alternative 13 min
- Validation, guard clauses and assertions — failing early with a useful message 12 min
- Reading stack traces and decoding the errors you will see most 12 min
- Checkpoint — Errors (checkpoint) 24 min
Module 8: Asynchronous JavaScript
The event loop and its two queues; error-first callbacks; promises and the chaining rules; async/await semantics, sequential versus concurrent, return await; the combinators, concurrency pools, timeouts and AbortController; timers, debounce and throttle.
- Callbacks and the event loop — one thread, two queues 14 min
- Promises — a value that is not here yet 14 min
- async/await — promises with the syntax of ordinary code 14 min
- Combinators, concurrency limits, timeouts and cancellation 14 min
- Timers and scheduling — setTimeout, setInterval, nextTick, and debounce/throttle 12 min
- Checkpoint — Asynchronous JavaScript (checkpoint) 25 min
Module 9: Modules and Node
CommonJS and ES modules, resolution and interop; package.json, npm, semver and lockfiles; the core modules — path, fs, process, events, url, crypto; Buffers and streams with pipeline and backpressure; arguments, environment, exit codes, signals, child processes and workers.
- CommonJS and ES modules — two module systems, one runtime 14 min
- Packages, package.json, npm and semver 12 min
- The core modules you use every week — fs, path, os, process, util, events, url, crypto 14 min
- Buffers and streams — bytes, and data that does not fit in memory 14 min
- The process — arguments, environment, exit codes, signals, child processes and workers 13 min
- Checkpoint — Modules and Node (checkpoint) 24 min
Module 10: Strings, Unicode, regular expressions and parsing
UTF-16 code units, code points and graphemes; normalisation, collation and Intl formatting; tagged templates; regular expressions from syntax to lookarounds, Unicode properties, escaping and ReDoS; tokenizers and recursive-descent parsers.
- Unicode and how JavaScript strings really work 13 min
- The string toolbox, template literals, tagged templates and Intl formatting 12 min
- Regular expressions — syntax, flags, groups and the five methods 14 min
- Regex in practice — lookarounds, Unicode properties, escaping input, ReDoS, and knowing when to stop 13 min
- Parsing text by hand — tokenizers, recursive descent, CSV and error positions 14 min
- Checkpoint — Strings, Unicode, regular expressions and parsing (checkpoint) 25 min
Module 11: Functional patterns
Pure functions and immutability with structural sharing; pipe, compose, currying and data-last design; reduce as the universal fold, recursion limits and trampolines; memoization, once and laziness; Maybe, Result and railway-oriented pipelines.
- Pure functions and immutability — why, and how far to take it 12 min
- Composition, currying and point-free style — building programs from small functions 13 min
- Folds, recursion and trampolines — reduce as the universal loop 12 min
- Memoization and laziness — computing once, and only when asked 12 min
- Maybe, Result and railway-oriented code — making absence and failure values 13 min
- Checkpoint — Functional patterns (checkpoint) 24 min
Module 12: The DOM and the browser
The DOM tree, selection, attributes versus properties and safe content; event propagation and delegation; fetch, URLs, CORS and timeouts; storage, cookies, history and observers; the rendering pipeline, loading path, vitals, XSS and CSRF.
- The DOM — the tree behind the page, and how to change it safely 13 min
- Events — propagation, delegation and the event object 13 min
- fetch, URLs, CORS and talking to servers 13 min
- Storage, cookies, history and the browser APIs worth knowing by name 12 min
- Rendering performance and front-end security — the two things a page must not get wrong 13 min
- Checkpoint — The DOM and the browser (checkpoint) 24 min
Module 13: TypeScript preview
Erased types and inference; any, unknown and never; interfaces, structural typing and discriminated unions; generics, keyof and the utility types; narrowing, type guards and assertions; tsconfig, declaration files, builds and migration.
- What TypeScript adds — erased types, inference, and any versus unknown versus never 13 min
- Object types, interfaces, structural typing and discriminated unions 13 min
- Function types, generics, keyof and the utility types 13 min
- Narrowing, type guards, assertions — making the compiler trust a value 12 min
- TypeScript in practice — tsconfig, declaration files, builds, migration and the errors you will see 12 min
- Checkpoint — TypeScript preview (checkpoint) 24 min
Module 14: Modern JavaScript and its tooling
ES2020–2022 in everyday code; the 2023+ additions, TC39 stages, feature detection and spec-faithful polyfills; bundlers, tree-shaking, code splitting and source maps; ESLint, Prettier, test runners and CI; Node, Deno, Bun, edge runtimes and the web-standard core.
- ES2020–ES2022 — the features that changed everyday code 13 min
- ES2023 onward, and how features get into the language 12 min
- Bundlers, transpilers and the build — what happens to your code before it runs 13 min
- Linting, formatting and testing — the quality toolchain 12 min
- Runtimes and the ecosystem — Node, Deno, Bun, browsers, edge, and the web-standard core 12 min
- Checkpoint — Modern JavaScript and its tooling (checkpoint) 24 min
Module 15: Performance and memory
How V8 runs code — tiers, hidden classes, inline caches, elements kinds; benchmarks that lie and profiles that do not; reachability, the generational collector and the leak catalogue; the habits that survive measurement; server latency at the percentile, round trips, caches, pools and event-loop lag.
- How V8 runs your code — parsing, tiers, hidden classes and inline caches 13 min
- Measure first — benchmarks that lie, profiles that do not, and reading the numbers 13 min
- Memory and garbage collection — generations, reachability, and the leaks that survive it 13 min
- Writing fast JavaScript — the habits that survive measurement 13 min
- Server and network performance — latency budgets, percentiles, caching and the event loop under load 13 min
- Checkpoint — Performance and memory (checkpoint) 24 min
Module 16: Interview idioms
The coding-round template and the JavaScript decisions to make before being asked; the twelve algorithm patterns; the idiom sheet and the trap behind each idiom; the reimplementation questions and the spec details that decide them; the theory repertoire in two-sentence answers.
- The template — running a JavaScript coding round from your side of the table 12 min
- The patterns — the dozen algorithm shapes behind most JavaScript rounds 14 min
- The idiom sheet — the one-liners worth knowing by heart, and the traps inside them 11 min
- Implement the built-in — the reimplementation questions and the details that decide them 14 min
- Theory drill — the questions, the two-sentence answers, and where each one goes deeper 14 min
- Checkpoint — Interview idioms (checkpoint) 26 min