JavaScript · Learn
The JavaScript curriculum
Runs in every browser and, with Node.js, on servers too. Event-driven, flexible and everywhere front-end work happens. This path has 19 lessons in reading order, from the basics to the ideas that come up in real code, with a runnable example in every lesson.
- lessons
- 19 lessons
- hours of reading
- 3 hours of reading
- exercises to practise
- 9 exercises to practise
Beginner
10 lessons · about 90 minutes of reading, plus practice.
- JavaScript Syntax and Your First ProgramHow a JavaScript program is laid out: statements, semicolons, blocks, comments, console.log() for output and readline() for input, with runnable examples.8 min
- Variables in JavaScript: let, const and varHow to declare variables in JavaScript with let, const and var, what block scope and hoisting mean, and why const is the default choice.8 min
- JavaScript Data Types: Primitives, Objects and typeofThe seven primitive types in JavaScript plus objects, what typeof reports, how numbers behave, and how to convert between strings, numbers and booleans.9 min
- JavaScript Operators: Arithmetic, Comparison and LogicJavaScript's arithmetic, assignment, comparison and logical operators, why === beats ==, how + behaves with strings, and what ?? and the ternary do.9 min
- Conditions in JavaScript: if, else if, else and switchHow if, else if, else and switch choose what runs in JavaScript, which values count as true, and how to write conditions that do what you meant.8 min
- Loops in JavaScript: for, while, for...of and for...infor, while, do...while, for...of and for...in loops in JavaScript, with break and continue, and how to read every line of input in a loop.9 min
- JavaScript Functions: Declarations, Arrows and Return ValuesHow to define and call JavaScript functions with declarations, expressions and arrow functions; parameters, default values, return and local scope.10 min
- JavaScript Arrays: Creating, Indexing and Changing ListsHow JavaScript arrays store ordered lists: indexing, length, push and pop, slice versus splice, sorting numbers correctly, and map, filter and reduce.10 min
- JavaScript Objects: Properties, Methods and NestingHow JavaScript objects group data as key-value properties: dot and bracket access, adding and deleting, methods with this, nesting and reference behaviour.10 min
- JavaScript Strings: Methods, Template Literals and SlicingJavaScript string basics: quotes, template literals, length and indexing, slice, split and join, trim, replace and case methods, and why strings never change.10 min
Intermediate
9 lessons · about 90 minutes of reading, plus practice.
- Destructuring in JavaScriptHow JavaScript destructuring unpacks arrays and objects into variables, with defaults, renaming, nested patterns, swaps and function parameters.9 min
- Spread and Rest in JavaScriptWhat the ... operator does in JavaScript: spreading arrays and objects into calls and literals, and collecting rest parameters and rest elements.9 min
- Scope and Hoisting in JavaScriptHow JavaScript decides where a variable is visible: global, function and block scope, how var and function declarations hoist, and why let has a dead zone.10 min
- Closures in JavaScriptWhat a JavaScript closure is, how a function keeps access to the scope it was created in, and how to use that for counters, factories and callbacks.10 min
- Classes in JavaScriptHow JavaScript classes work: constructors and this, methods on the prototype, getters, static members, extends and super, and private fields with #.11 min
- Error Handling in JavaScriptHow JavaScript reports and recovers from failure: throw and Error objects, try/catch/finally, built-in error types, custom error classes and the cause option.10 min
- Modules in JavaScriptHow JavaScript ES modules split a program into files: named and default exports, import forms, module scope, single evaluation and the contrast with CommonJS.10 min
- DOM Basics in JavaScriptHow JavaScript reads and changes a web page through the DOM: querySelector, textContent and innerHTML, classList, createElement and append, and script timing.11 min
- Events in JavaScriptHow JavaScript events work: addEventListener and removeEventListener, the event object, preventDefault, custom events, bubbling and event delegation.11 min