HomeJavaScript
Language
JavaScript
The language of the browser, in the order it makes sense. Short lessons, a live editor on every page, and checks that tell you when you got it right.
19 lessons4 projects30 exercises~320 min
The curriculum
23 steps, in the order they make sense.
0/30exercises solved
01
Basics
Variables, values and control flow
5 lessons · 5 exercises
- 01Variables: let, const, and the values you keepStore a value under a name, choose between let and const, and print something useful.8 min→
- 02Data types and the typeof operatorStrings, numbers, booleans, null and undefined — plus why typeof null is a lie.9 min→
- 03Operators: math, comparison and logicArithmetic, strict equality, && and ||, and the nullish coalescing operator that saves defaults.9 min→
- 04Conditionals: if, else and switchPick a path through your code with if, else if, else — and know when a switch reads better.8 min→
- 05Loops: repeat without repeating yourselffor, while, for...of and for...in — and how to build up an array one item at a time.10 min→
02
Functions & data
Functions, arrays, objects
4 lessons · 5 exercises
- 06Functions: the verbs of your programDeclarations, arrow functions, defaults, rest parameters and functions that take functions.10 min→
- 07Arrays: ordered lists you can trustIndexes, length, push and pop, slice vs splice, spread and destructuring.10 min→
- 08Objects: grouped, named dataProperties, bracket access, methods, destructuring, spread and the three object static helpers.11 min→
- 09Array methods: map, filter, reduce and friendsStop writing loops by hand. Transform, select and collapse arrays with intent.12 min→
03
The browser
DOM, events and forms
3 lessons · 3 exercises
- 10The DOM: your page as a tree of objectsSelect elements, read and write text, create nodes and put them on the page.11 min→
- 11Events: making the page respondaddEventListener, the event object, and reading state back out of the DOM.10 min→
- 12Forms: reading input and validating itRead values, intercept submit with preventDefault, trim input and show feedback.10 min→
04
Advanced
Closures, classes, modules, errors
4 lessons · 5 exercises
- 13Closures: functions that rememberA function keeps access to the scope where it was created — that is the whole idea, and it is powerful.11 min→
- 14Classes: blueprints for objectsConstructors, methods, getters, inheritance with extends, and truly private fields.12 min→
- 15Modules: split code into files that know their jobNamed and default exports, import syntax, and how to keep a codebase navigable.9 min→
- 16Error handling: fail loudly, recover deliberatelythrow, try, catch, finally, custom errors and the difference between a bug and an expected failure.11 min→
05
Async
Promises, async/await, fetch
3 lessons · 4 exercises
- 17Promises: a value that arrives laterPending, fulfilled, rejected — and the three methods that combine several promises at once.12 min→
- 18async / await: promises that read like proseMark a function async, await the value, and catch failures with plain try / catch.10 min→
- 19fetch: talking to an APIGET, check response.ok, parse JSON, POST a body, and abort a slow request.12 min→
06
Projects
Four small apps, built for real
4 lessons · 8 exercises
- 20Project: To-do listprojectPure state functions plus a small render step — the pattern behind most real interfaces.35 min→
- 21Project: Quiz appprojectScore answers from a data structure, then render a question that reacts to clicks.30 min→
- 22Project: Weather appprojectFetch a city, format the data, and handle the city that does not exist.30 min→
- 23Project: CalculatorprojectTurn a string of button presses into state — the reducer pattern in miniature.30 min→
19 lessons plus 4 projects, 30 checked exercises. Every check runs in your browser.