JavaScript
Understand the language behind interactive websites.
Beginner
Your first JavaScript program
JavaScript evaluates expressions and can report their values in a console.
Variables with let and const
Choose between reassignment and a fixed binding in JavaScript.
Types, conversions, and equality
JavaScript values have types such as number, string, and boolean.
Strings and template literals
A template literal lets you include values directly inside a string.
Branches and loops
Follow JavaScript conditions and count through a loop without a boundary error.
Functions and scope
Break JavaScript into named operations and identify where a variable can be read.
Arrays and objects
Organize items by position and model a record with named properties.
Intermediate
Promises and async functions
See where an async function pauses and why surrounding JavaScript can continue.
Destructuring, rest, and spread
Destructuring names selected values, while spread expands the contents of an array or object.
Map, filter, and reduce
Array methods express whether you want to transform elements, choose a subset, or combine the array into one result.
The DOM and browser events
The DOM is the browser’s tree of page elements, and events let your JavaScript respond to what happens there.
JavaScript modules and imports
Modules let you expose selected values to other files and keep the rest local.
Fetch, HTTP errors, and cancellation
Fetch requests data and resolves to a response whose status you can inspect.
Map and Set in JavaScript
A Map associates keys with values, and a Set keeps one entry per distinct value.
Optional chaining and missing values
Optional chaining stops reading a property when the preceding value is null or undefined.
Advanced
Closures and private function state
A closure is a function that keeps access to variables from the place it was created.
Objects, prototypes, and this
A prototype lets objects share behavior, and this often refers to the receiver in a method call.
The event loop and microtasks
The event loop runs queued work after the current JavaScript stack finishes.
Iterables and generators
An iterable can hand its values to a for-of loop, and a generator supplies them one at a time.
Web workers and message passing
A web worker can do background computation so the page remains responsive.
Memory and event listener cleanup
Objects remain in memory while reachable code can still find them.
Coordinating multiple promises
Promise combinators describe how a group of delayed operations should finish together.