The console shows what your code printed, not how it got there.

Replay your code, backwards too.

JSpark records a Node Run Step by Step, and lets you move through it, backwards as well as forwards. Nothing runs again.

01

Step through a Run, backwards too

JSpark runs the Snippet once and records every Step. Then you move back and forward through the recording, and nothing runs again.

A real recording of factorial(4). Moving back to an earlier Step runs nothing again.
02

What each Step changed

Variables lists every name in scope at the Step, grouped by scope. A name the Step changed is lit.

Step 5, the loop’s second turn: score became 7 and total became 12, so both are lit.
03

A name’s value then, and what a closure remembers

Hover a name to see its value at the Step on screen, never a later one. A name a function keeps from further out is marked remembered.

makeCounter has returned, yet count keeps going up, 1 then 2. Variables marks it as remembered.
04

Objects as they were

An object shows what it held at each Step, not what it became later.

At Step 5, cart holds two items and a total of 3, though by the end its total is 8.
05

The console, up to this Step

The line printed at this Step is lit, and later output is dimmed. Next Step with output jumps to the next Step that printed.

Each press jumps to the next console.log. Its line lights, and what prints later stays dim.
06

Inside lines JSpark+

Step into each call, callback and loop check, and see what each one came to, such as score >= 10 → true.

The filter, map and reduce callbacks each get a Step of their own, with what they came to.
07

The Call Stack JSpark+

At every Step, see which function called the one you are in, with each call’s arguments and line.

Five calls of factorial pile up, each with its own n, then unwind as they return.
08

Longer recordings JSpark+

JSpark records up to 5,000 Steps. JSpark+ records 200,000 at first, and up to 2,000,000 when you ask for more. A recording that stopped early says so, and offers to record more.

This loop needs 10,000 Steps. The bar says the recording is incomplete, and offers to record more.

Good to know

Node Snippets only
A Web Snippet runs as a live page and has no Timeline.
The editor waits
While the Timeline is open, the code is read-only and Run as you type waits. Esc goes back to editing.
Steps you can use
A recording that ran out of room keeps the Steps it recorded, and you can still move through them.
Keys
⌘⇧↵ opens the Timeline, ⌘← and ⌘→ move one Step, and Space plays and pauses.

Read the Timeline docs All features

Next time a loop surprises you, replay it.

Download free for Mac

Not a trial: it doesn’t expire.

Windows: coming later