JavaScript
JavaScript Code Completion Exercises
Complete focused JavaScript snippets as you learn variables, expressions, control flow, functions, and beyond.
Interactive exercises that help you practice, check your understanding, and find what to revisit.
Start here
Complete the variable bindings
Complete each JavaScript snippet by supplying the missing declaration, assignment, or template substitution. Check every challenge as you go.
Explore the collection
Exercises
Browse the complete collection and choose the resource that matches what you want to practice or understand.
-
ExercisesBeginner
Complete the variable bindings
Complete each JavaScript snippet by supplying the missing declaration, assignment, or template substitution. Check every challenge as you go.
~5 min read Start exercise -
ExercisesBeginner
Complete the number calculations
Complete each JavaScript snippet by supplying the missing numeric expression or type-aware operation.
~6 min read Start exercise -
ExercisesBeginner
Complete the expressions
Practice operators, short-circuiting, nullish coalescing, conditional expressions, and grouping by completing real JavaScript code.
~7 min read Start exercise -
ExercisesIntermediate
Complete the values, types, and equality expressions
Practice explicit conversion, strict equality, NaN checks, nullish fallback, BigInt, SameValue, and numeric comparison by completing real JavaScript code.
~7 min read Start exercise -
ExercisesIntermediate
Complete the control-flow and declaration code
Practice branching, switch control, loop control, returns, exceptions, cleanup, and safe return syntax by completing real JavaScript code.
~8 min read Start exercise -
ExercisesIntermediate
Complete the scope and closure code
Practice lexical scope, shadowing, closures, callbacks, loop bindings, and name resolution by completing real JavaScript code.
~8 min read Start exercise -
Exercises
JavaScript Execution Model: Contexts, Realms, Jobs & Agents — Code Completion
Practice execution-model concepts with small JavaScript completions.
Start exercise -
Exercises
JavaScript Explicit Resource Management — Code Completion
Practice using declarations, disposal protocols, and disposable stacks.
Start exercise -
Exercises
Modern ECMAScript Update Pass — Code Completion
Practice selecting modern standardized ECMAScript APIs.
Start exercise -
Exercises
JavaScript Weak References & FinalizationRegistry — Code Completion
Practice WeakRef, FinalizationRegistry, unregister tokens, and safe weak-lifetime handling.
Start exercise -
ExercisesIntermediate
Complete the function objects and this code
Practice function objects, call-site this, arrow functions, call/apply/bind, and constructor calls by completing real JavaScript.
~8 min read Start exercise -
ExercisesIntermediate
Complete the JavaScript Architecture Code
Practice focused APIs, dependency injection, composition roots, adapters, state ownership, and lifecycle boundaries.
~8 min read Start exercise -
ExercisesIntermediate
Complete the JavaScript Arrays code
Practice transformations, selection, reduction, searching, non-mutating edits, materialization, and grouping with JavaScript arrays.
~8 min read Start exercise -
ExercisesIntermediate
Complete the JavaScript Async Code
Practice async functions, await, error handling, async iteration, and Array.fromAsync.
~8 min read Start exercise -
ExercisesIntermediate
Complete the JavaScript Errors and Defensive Control Flow Code
Practice throwing, preserving causes, cleanup, classification, aggregation, and propagation.
~8 min read Start exercise -
ExercisesIntermediate
Complete the JavaScript Iterators and Generators Code
Practice the iterable protocol, generator control flow, delegation, and lazy iterator helpers.
~8 min read Start exercise -
ExercisesAdvanced
Complete the JavaScript JSON Code
Practice JSON parsing, serialization, formatting, and transformation hooks.
~8 min read Start exercise -
ExercisesIntermediate
Complete the JavaScript keyed collections code
Practice Map association, Set membership and algebra, and WeakMap object-keyed metadata.
~8 min read Start exercise -
ExercisesIntermediate
Complete the JavaScript Promises Code
Practice chaining and choosing Promise APIs by outcome contract.
~8 min read Start exercise -
ExercisesAdvanced
Complete the JavaScript Regular Expression Code
Practice patterns, captures, flags, match indices, Unicode properties, and global replacement.
~8 min read Start exercise -
ExercisesAdvanced
Complete the JavaScript Symbols Code
Practice Symbol keys, registry operations, reflection, and protocol hooks.
~8 min read Start exercise -
ExercisesIntermediate
Complete the JavaScript Unicode String Code
Practice code-point iteration, well-formedness, normalization, and Unicode-aware String APIs.
~8 min read Start exercise -
ExercisesIntermediate
Complete the objects and prototypes code
Practice prototype creation, property ownership, lookup, shared methods, and descriptors.
~8 min read Start exercise -
ExercisesIntermediate
Complete the property descriptors and integrity code
Practice descriptor inspection, accessor definition, and object integrity operations.
~8 min read Start exercise -
ExercisesIntermediate
Complete the Proxy and Reflect code
Practice creating proxies and forwarding intercepted operations with Reflect.
~8 min read Start exercise -
Exercises
JavaScript Binary Data — Code Completion
Practice ArrayBuffer, TypedArrays, and DataView operations.
Start exercise -
Exercises
JavaScript Classes — Code Completion
Practice class declarations, constructors, inheritance, public and private elements, and static initialization.
Start exercise -
Exercises
JavaScript Dates and Modern Time with Temporal — Code Completion
Practice the core Date and Temporal APIs.
Start exercise -
Exercises
JavaScript Global Object & Standard Global Functions — Code Completion
Practice the remaining standard global access and function APIs.
~12 min read Start exercise -
Exercises
JavaScript Internationalization with Intl — Code Completion
Practice core ECMA-402 Intl services.
Start exercise -
Exercises
JavaScript Source Text, Lexical Grammar & Parsing — Code Completion
Practice recognizing source-level grammar constructs, directives, literals, comments, and statement boundaries.
Start exercise -
Exercises
JavaScript Shared Memory — Code Completion
Practice SharedArrayBuffer and Atomics operations.
Start exercise