Learn JavaScript.
Understand scope, functions, objects, and asynchronous execution.
JavaScript essentials
Start with the essentials or pick the concept you need.
01Scope & executionExplore concepts
02Functions & objectsExplore concepts
03Async JavaScriptExplore concepts
What you will study in JavaScript
Focused lessons organized by concept. Start with the explanation, trace the examples, and check your recall before moving on.
Scope & execution
An execution context is the information JavaScript uses while running a piece of code, including its variables, scope and this value. The call stack tracks which function is currently running and where execution should return. Each function call adds a context, and returning removes it.
Functions & objects
A closure is a function together with access to the variables in the scope where it was created. That access remains available even after the outer function has finished running. Closures are useful for private state, callbacks and functions configured with some remembered value.
Async JavaScript
Asynchronous JavaScript lets a program start work that may finish later without waiting synchronously for the result. A promise represents eventual completion, and async/await provides a readable way to work with promises. The runtime queues continuations and runs them when the current synchronous work has finished and the relevant checkpoints are reached.