Runners

Examples

Editable examples run locally in the browser or in WebContainer.

Event loop output order Edit and run a small browser JavaScript example that captures console output. browser Coercion and equality table Compare ==, ===, Object.is, and truthiness for values that often appear in interviews. browser Closure-backed private counter Use a closure to keep state private while exposing a small public API. browser Prototype delegation lookup Show that prototype methods are delegated and not copied onto each instance. browser Promise.all fail-fast rejection Run a small Promise.all example to see how the aggregate promise rejects. browser ES module live binding Demonstrate that imported ES module bindings observe updates made by the exporting module. browser WeakMap metadata cache Associate metadata with objects without making that metadata enumerable or keeping keys strongly reachable. browser Unknown boundary guard Model the TypeScript habit of parsing unknown data before using it in application code. browser Discriminated request state Represent request states as explicit variants and handle them with exhaustive-style branching. browser satisfies-style config table Use a precise config table while preserving literal keys and validating the expected shape. browser Deterministic test fixture Use a fixed clock and fixture data so a test-style assertion is repeatable. browser Strategy pattern validation Swap validation policy through a strategy function while the use case stays stable. browser Outbox and idempotent consumer Simulate committing local state with an outbox event and ignoring duplicate messages at the consumer boundary. browser Native form validation state Use the browser constraint validation API to inspect required and email fields without custom parsing. browser Accessible form error wiring Connect a label, invalid state, and described-by error text so assistive technology receives the same context as sighted users. browser Native button behavior Show why a native button is preferable to a div role when you need focus and activation behavior. browser Container query card layout Create a component that changes its own grid layout from container width instead of viewport width. browser Batch style reads and writes Compare the shape of interleaved layout reads/writes with a batched approach that avoids repeated synchronous layout work. browser Delegated DOM event handling Use one parent listener to handle child button actions and dispatch a small custom event. browser Storage and worker boundary Demonstrate that local storage is synchronous main-thread state while worker messages cross an isolated execution boundary. browser Functional state update simulation Simulate why React state updates that depend on previous state should use updater functions. browser Controlled form state Model the data flow of a controlled input: DOM event payload becomes state, and state drives the rendered value. browser Cache tag revalidation flow Simulate how a mutation can invalidate cached reads by tag without disabling caching for every route. browser Server/client boundary payload Show the shape of data that crosses from server work to an interactive client component. browser Normalized selector cache Normalize entities and derive a view model through a selector that can be invalidated after writes. browser Optimistic update rollback Apply an optimistic cache change, then roll it back when the simulated server mutation fails. browser Tracked ref update Simulate how a ref change triggers a dependent computed value in Vue reactivity. browser Fetch key deduplication Show how a stable key lets server and client reuse the same cached payload. browser Node EventEmitter Run a tiny Node.js event example through WebContainer when the browser supports it. node Readable stream chunks Run a tiny stream example that counts chunks and bytes without buffering the whole payload manually. node Graceful shutdown state machine Simulate the shutdown sequence: stop accepting work, wait for in-flight work, then exit cleanly. node Middleware validation chain Model request validation, handler work, and centralized error response shaping without a real server. node HTTP idempotency and pagination shape Return the same result for a repeated idempotency key and expose a cursor-style next page token. node Safe encoding and security headers Encode untrusted HTML text and shape a minimal set of defensive response headers. node N+1 query batching Compare the number of lookups made by per-row fetching and a batched lookup. browser Transaction rollback model Model how a failed transaction leaves account balances unchanged. browser Package exports resolution Resolve a tiny package exports map to show how tooling chooses browser and Node entry points. browser Affected monorepo graph Walk a dependency graph to find packages affected by a shared package change. browser Structured log redaction Create a correlated JSON log entry while redacting sensitive fields. browser RED metrics summary Compute rate, errors, and duration from a tiny request sample. browser Performance marks and measures Use a deterministic performance-style timeline to explain why measurements need named boundaries. browser Bounded queue backpressure Reject excess work when a bounded queue is full instead of accepting infinite latency. browser