Lumenary CS · Programming languages
JavaScript
The language of the web, from a first script to asynchronous programs, browser code and the tools professionals use every day.
JavaScript is the programming language built into every web browser, and with Node.js, Deno and Bun it also runs web servers, command-line tools, build systems and desktop apps. It first appeared in 1995 and is standardised as ECMAScript by Ecma International's TC39 committee, which publishes a new edition every year. This course teaches modern JavaScript as of ECMAScript 2025: values and types (and the coercions that trip people up), control flow and functions, closures and this, objects, prototypes and classes, arrays and collections, errors and testing, the event loop and async/await, the browser's DOM and events, and the tools of a working JavaScript developer, ending with a complete small project.
It is written for anyone who has finished the Start level of Lumenary CS, or has equivalent experience: you know what a variable, a loop and a function are, in any language. No experience of the web is assumed.
To run the examples, install the current long-term-support (LTS) release of Node.js from nodejs.org, save a program as main.mjs and run node main.mjs. Every complete program in these lessons is run by Lumenary's test suite as an ES module under Node 22, and the output shown beside it is what it actually printed. Code that needs a web page is shown separately and explained; you can try it in the developer console of any browser (open it with F12, or Cmd+Option+J on a Mac), which is the nearest thing JavaScript has to an official playground.
- Chloe · The Designer
“Why is the language built this way?” - Margaret · The Profiler
“What does it print, and what does it cost?” - Gideon · The Language Lawyer
“What exactly does the language guarantee?”
Foundations · 4 lessons
The core language
Where JavaScript runs and how to run it, its values and types, control flow and functions, and the scopes, closures and this-binding that make JavaScript functions what they are.
- 1First stepsWhere JavaScript came from, where it runs today, and how to run your first program. 45 min
- 2Values, types and variablesNumbers, strings and the other primitives, let and const, and the conversions JavaScript makes behind your back. 55 min
- 3Control flow and functionsDecisions, loops, and the three ways to write a function, with functions as values you can pass around. 55 min
- 4Scope, closures and thisWhich variables a function can see, why it remembers them, and the one keyword whose meaning depends on the call. 55 min
Practice · 3 lessons
Working with data
Objects, prototypes and classes; arrays, destructuring, spread and the built-in collections; and errors and tests, so programs fail clearly and stay correct.
- 5Objects, prototypes and classesObject literals, the prototype chain underneath everything, and the class syntax built on top of it. 60 min
- 6Arrays, destructuring and collectionsThe array methods that replace most loops, destructuring and spread, Map and Set, and the iterators behind for...of. 60 min
- 7Errors and testingThrowing and catching well, errors with causes, and testing your code with the runner built into Node. 55 min
Professional · 3 lessons
Asynchronous code, the browser and the ecosystem
The event loop, promises and async/await; the DOM and events in the browser; and modules, npm, bundlers and linters, ending with a complete small project.
- 8The event loop, promises and async/awaitHow one thread handles thousands of waiting tasks, and how to write asynchronous code that reads like ordinary code. 65 min
- 9In the browser: the DOM and eventsHow JavaScript reads and changes a web page, responds to the people using it, and does so safely and quickly. 60 min
- 10Modules, tooling and a projectSplitting code into ES modules, npm and package.json, the tools professionals run every day, and a complete program that uses everything in the course. 70 min
Further reading and resources
- MDN Web Docs: JavaScript · Mozilla and contributorsThe reference most working JavaScript developers keep open: a guide, a complete reference and browser-compatibility tables.
- ECMAScript Language Specification (the living draft) · Ecma TC39The standard that defines the language, updated as proposals are accepted.
- ECMA-262, the published standard · Ecma InternationalThe yearly editions of the standard; ECMAScript 2025 is the 16th edition.
- TC39 proposals · Ecma TC39Every feature on its way into the language, with its current stage.
- Node.js documentation · OpenJS FoundationThe runtime the course's programs run on: its built-in modules, from files to tests.