JavaScript
Learn JavaScript from variables to async code and the DOM. Examples run instantly in your browser, with console.log output right below the code.
- 7 modules
- 31 lessons
- 154 runnable examples
- Beginner to advanced
Getting started
Your first lines of JavaScript.
Control flow
Decisions and loops.
Functions
Reusable blocks of code.
Arrays and objects
Structuring data.
The DOM
Making web pages interactive.
Asynchronous JavaScript
Waiting without freezing.
Modern JavaScript
Classes, modules and more.
Add two numbersRead two numbers and print their sum. SolvedEasy+30 XPPositive, negative or zeroDescribe the sign of a number. SolvedEasy+30 XPTitle CaseCapitalise the first letter of every word. SolvedEasy+30 XPReverse the wordsSame words, opposite order. SolvedEasy+30 XPMin, max and averageSummarise a list of numbers. SolvedMedium+50 XPUnique and sortedRemove duplicates, then sort numerically. SolvedMedium+50 XPFizzBuzzMultiples of 3 and 5, in JavaScript. SolvedEasy+30 XPcamelCase to snake_caseConvert variable names between styles. SolvedMedium+50 XPBalanced bracketsAre the brackets properly nested? SolvedHard+80 XP
JavaScript quiz
Ten questions drawn at random from 85, with an explanation after every answer. Score 70% to pass; a perfect round earns a badge.
- Treasure Quest
Sail across eight islands. Each one asks a question; lose three hearts and it's back to port.
- Speed Run
Sixty seconds on the clock. Every right answer scores, and a wrong one costs five seconds.
- Code Puzzle
Real code from the lessons, shuffled line by line. Put it back in the right order.