Skip to content
Astera Technology

JavaScript values and execution

Trace fixed programs, compare their outputs and work through a bounded alternative.

Astera Technology

Distinguish a constant binding from an immutable object

Change an object property, then try to replace the constant binding.

Practical lesson
Astera Technology

Keep independent state in separate closures

Interleave two counters and identify which stored value each call advances.

Practical lesson
Astera Technology

Return a value that another function can use

Compare a recorded side effect with a value returned to the caller.

Practical lesson
Astera Technology

Compare the types before matching a value

Keep operand types visible when comparing numbers, text and nullish values.

Practical lesson
Astera Technology

See which operand actually runs

Trace skipped function calls as well as the final logical values.

Practical lesson
Astera Technology

Find the nested reference shared by a shallow copy

Separate copied top-level values from a nested object that remains shared.

Practical lesson
Astera Technology

Apply a function default only when the argument is undefined

Test omitted, undefined, null and empty-string arguments separately.

Practical lesson
Astera Technology

Transform a displayed list without editing its source

Filter visibility and format IDs while retaining the supplied source records.

Practical lesson
Astera Technology

Group arbitrary labels without confusing them with object properties

Count labels with Map, including a name inherited by ordinary objects.

Practical lesson
Astera Technology

Sort a copy and keep equal-score order

Sort numeric scores on a copied array and inspect equal-score ordering.

Practical lesson
Astera Technology

Use a once listener safely during reentrant dispatch

Dispatch the same event inside a once listener and count invocations.

Practical lesson
Astera Technology

Predict synchronous code and queued microtasks

Trace a resolved promise reaction and queueMicrotask after synchronous work.

Practical lesson
Astera Technology

Run cleanup without turning an error into success

Run cleanup while keeping the original async failure available to catch.

Practical lesson
Astera Technology

Collect mixed local promise outcomes in input order

Read every local settlement record in the original job order.

Practical lesson
Astera Technology

Generate values only when iteration asks for them

Count the work performed by two next calls on a finite generator.

Practical lesson
Astera Technology

Reset a stateful regular expression before repeated tests

Follow lastIndex across repeated tests of one global regular expression.

Practical lesson
Astera Technology

Preserve repeated query values and escape delimiters

Serialize repeated parameters and preserve an ampersand and a space.

Practical lesson
Astera Technology

Distinguish an empty array slot from an undefined element

Inspect index presence before counting map callbacks in a sparse array.

Practical lesson
Astera Technology

Keep event detail separate from a copied snapshot

Compare event.detail identity with the payload supplied at construction.

Practical lesson