Learn JavaScript – all lessons
16 lessons from beginner to advanced, building on each other and with code examples.
Hello World & console.log
Your first program, comments and output.
Variables & Data Types
let, const, the primitive types and conversions.
Conditions & Comparisons
if, switch, === instead of ==, truthy/falsy and the operators ?? and ?.
Loops
for, for...of, for...in, while, break and continue.
Functions
Declarations, arrow functions, default values and rest parameters.
Arrays, Objects, Map & Set
The most important data structures – and what const really means.
Array Methods: map, filter, reduce
Transforming data functionally – everyday JavaScript.
Destructuring, Spread & Rest
Unpacking, copying and merging values.
Strings, Regex & JSON
Processing text, searching for patterns and exchanging data.
Error Handling
try/catch/finally, custom error classes and typical error types.
Classes & Object-Oriented Programming
class, extends, private fields, getters and prototypes.
DOM & Events in the Browser
Creating and changing elements and reacting to clicks.
Closures, Scope & this
Why functions "take along" their environment and what this really means.
Asynchronous Programming
Event loop, promises, async/await and typical pitfalls.
Iterators & Generators
Making your own collections iterable and producing values lazily.
Modules, npm & Tooling
ES modules, package.json, bundlers and quality tools.