JavaScript values and execution
Trace fixed programs, compare their outputs and work through a bounded alternative.
Distinguish a constant binding from an immutable object
Change an object property, then try to replace the constant binding.
Keep independent state in separate closures
Interleave two counters and identify which stored value each call advances.
Return a value that another function can use
Compare a recorded side effect with a value returned to the caller.
Compare the types before matching a value
Keep operand types visible when comparing numbers, text and nullish values.
See which operand actually runs
Trace skipped function calls as well as the final logical values.
Find the nested reference shared by a shallow copy
Separate copied top-level values from a nested object that remains shared.
Apply a function default only when the argument is undefined
Test omitted, undefined, null and empty-string arguments separately.
Transform a displayed list without editing its source
Filter visibility and format IDs while retaining the supplied source records.
Group arbitrary labels without confusing them with object properties
Count labels with Map, including a name inherited by ordinary objects.
Sort a copy and keep equal-score order
Sort numeric scores on a copied array and inspect equal-score ordering.
Use a once listener safely during reentrant dispatch
Dispatch the same event inside a once listener and count invocations.
Predict synchronous code and queued microtasks
Trace a resolved promise reaction and queueMicrotask after synchronous work.
Run cleanup without turning an error into success
Run cleanup while keeping the original async failure available to catch.
Collect mixed local promise outcomes in input order
Read every local settlement record in the original job order.
Generate values only when iteration asks for them
Count the work performed by two next calls on a finite generator.
Reset a stateful regular expression before repeated tests
Follow lastIndex across repeated tests of one global regular expression.
Preserve repeated query values and escape delimiters
Serialize repeated parameters and preserve an ampersand and a space.
Distinguish an empty array slot from an undefined element
Inspect index presence before counting map callbacks in a sparse array.
Keep event detail separate from a copied snapshot
Compare event.detail identity with the payload supplied at construction.