JavaScript (ES2026) practice
74 exercises and 75 quizzes from the lessons of this track. Sample tests run in your browser; what you pass is kept in this browser only.
Start here: what JavaScript is and how to run it
- Quiz: JavaScript, ECMAScript and where code runs
- Greet the host your code runs in
- Quiz: Run JavaScript in the browser, the runner and Node
- Fix the TypeError in a parcel label
- Quiz: The console and reading error messages
- Repair four functions broken by line breaks
- Quiz: Statements, semicolons, comments and strict mode
- Port a Python expense report to JavaScript
- Quiz: JavaScript for Python developers
- Translate a Java Inventory class to JavaScript
- Quiz: JavaScript for Java developers
Values, types and operators
- Fix two bugs that come from var
- Quiz: Variables with let and const
- Name the type of any value
- Quiz: Primitive types and typeof
- Split a bill into shares that add up exactly
- Quiz: Numbers and floating-point arithmetic
- Round to decimal places and pick a random integer
- Quiz: Math, rounding and random numbers
- Send BigInt IDs through JSON as strings
- Quiz: BigInt for arbitrarily large integers
- Format a train ticket as aligned text
- Quiz: Strings and template literals
- Tell a blank form field from a real answer
- Quiz: Booleans, truthy and falsy values
- Read an optional floor number without a crash
- Quiz: null, undefined, optional chaining and ??
- Parse a typed amount of money into whole cents
- Quiz: Type conversion and coercion
- Compare two objects or arrays one level deep
- Quiz: Equality: ==, === and Object.is
- Grant, revoke and test permission flags
- Quiz: Operators, short-circuiting and precedence
Control flow
- Choose the fare category of a passenger
- Quiz: Conditionals: if, else and the ternary operator
- Turn a switch of single status codes into classes
- Quiz: switch statements and lookup tables
- Find the first repeated character and count digits
- Quiz: Loops: for, while, do…while, break and continue
- Total an object of scores and find a Map's top scorer
- Quiz: for…of vs for…in
Functions, scope and closures
- Return a loan's total interest and its first-month split
- Quiz: Function declarations, expressions and return values
- A logger with an options object and a rest parameter
- Quiz: Parameters, defaults and rest parameters
- Turn functions into arrows where an arrow fits
- Quiz: Arrow functions
- Fix an accidental global and a shadowed variable
- Quiz: Scope, the scope chain and execution contexts
- Rewrite three var helpers with let and const
- Quiz: Hoisting, var and the temporal dead zone
- Build a rate limiter that keeps its state in a closure
- Quiz: Closures in JavaScript
- Write pipe, compose and tap
- Quiz: Higher-order functions and callbacks
- Add up a folder tree, recursively and with a stack
- Quiz: Recursion and the call stack
Objects in depth
- Count items by key, for every possible key
- Quiz: Object literals, properties and methods
- Change a quantity without changing the cart
- Quiz: References, copying and structuredClone
- A cart whose methods survive being passed around
- Quiz: Methods and the this keyword
- Write bind yourself, with preset arguments and new
- Quiz: call, apply and bind
- Write mapValues and pickBy for plain objects
- Quiz: Object.keys, entries, fromEntries and key order
- Format an address that may have parts missing
- Quiz: Destructuring objects and arrays
Arrays and array methods
- Build a grid without shared rows, then transpose it
- Quiz: Arrays: creating, reading and length
- Move an item into a new array, and remove every match in place
- Quiz: Adding and removing items
- Find the latest passing attempt and check that every invoice is paid
- Quiz: Searching: includes, indexOf, find, some and every
- List the students who passed, with their names in title case
- Quiz: Transforming arrays with map, filter and forEach
- Total a month's expenses per category in a Map
- Quiz: reduce in depth
- Order a departure board by time, platform and name
- Quiz: Sorting arrays correctly
- Rewrite a to-do reducer with the copying methods
- Quiz: Copying array methods: toSorted, toSpliced, with
- Write range() and chunk() with Array.from
- Quiz: flat, flatMap, Array.from and array-likes
- Total a statement's credits and debits per day
- Quiz: Grouping data with Object.groupBy and Map.groupBy
Strings, Unicode and regular expressions
Map, Set and weak collections
- Count words into a Map, most frequent first
- Quiz: Map: keys of any type and the ES2026 upsert methods
- Compare the students of two courses
- Quiz: Set and the ES2025 set methods
- Remember results per argument without keeping objects alive
- Quiz: WeakMap, WeakSet, WeakRef and FinalizationRegistry
- Keep the last searches, newest first, without repeats
- Quiz: Choosing between objects, arrays, Map and Set
Errors and debugging
- Cleanup that keeps the first error
- Quiz: try, catch, finally and throw
- Throw the right error for each bad booking
- Quiz: Built-in error types and engine messages
- An HttpError and the chain of its causes
- Quiz: Custom errors, error cause and Error.isError
- Find the line where the invoice goes wrong
- Quiz: Debugging in DevTools and Node
Iterators and generators
- Make a Playlist iterable and shuffle it with a random function you pass in
- Quiz: The iteration protocols
- Write paginate and cycle as generator functions
- Quiz: Generator functions
- Tokenize arithmetic with a generator that can put a token back
- Quiz: Two-way generators: next, return, throw, yield*
- Rewrite three array pipelines with lazy iterator helpers
- Quiz: Iterator helpers: lazy map, filter, take and more
- Write zipLongest and chunked with native fast paths
- Quiz: Combining iterators: concat, zip, chunks and join
Prototypes and classes
- Find which object in the chain owns a property
- Quiz: Prototypes and the prototype chain
- Write your own new as a function
- Quiz: Constructor functions and the new operator
- A hall counter that other code cannot change or forge
- Quiz: Private fields, methods and brand checks
- A Map that keeps only its newest entries
- Quiz: Extending built-ins: Array, Error and Map
- Type checks that work for values from any realm
- Quiz: instanceof, duck typing and cross-realm checks
- Turn a fare class hierarchy into composed rules
- Quiz: Composition, mixins and OOP design in JavaScript
Modules, packages and build tools
- Give a counter module a live, minimal public API
- Quiz: ES modules: import and export
- Build a tiny CommonJS require() with a module cache
- Quiz: CommonJS, require(esm) and dual packages in Node
- Review a package.json for risky dependency specifiers
- Quiz: npm, semver, lockfiles and supply-chain safety
- Read an esbuild metafile and summarise the build
- Quiz: Bundlers, transpilers, polyfills and Baseline
- Remove the import-time work from a price feed module
- Quiz: Designing module boundaries and public APIs
Asynchronous JavaScript
The DOM
Results here are what this browser has checked: feedback for you, not proof. They stay on this device; your Learn progress can be exported to a file. · Back to the JavaScript (ES2026) track