Most lines print nothing to the console.
Peek: see a line’s value, with no console.log.
End a line with //? and its value appears beside it, after every Run. Here is what it shows in a loop, before and after a change, several at once, and when there is no value.
See one line’s value
End a line with //? and, after the Run, its value appears beside it. In a loop, it is the value from the last pass.
Every pass of a loop JSpark+
Hover the value and see what the line came to on each pass, in order, and how many times it ran.
Just part of a value
After code, write an expression of $, the line’s value, such as //? $.length. If it throws, the Peek shows the error and the Run goes on.
Before and after
Put the same Peek before and after a line, and see what the line changed.
Several values at once
A /*? block takes one name on each line, so related values sit side by side.
When there is no value
A Peek always says something. A line the Run never reached says not reached, in lighter slanted text.
Step by Step, in the Timeline
In the Timeline, a Peek shows its value at the Step on screen, so it changes as you move through the Steps.
TimelineEditing is paused while you replay · Esc to go back
Nothing in scope
everywhere
everywhere
in this loop
everywhere
in this loop
everywhere
in this loop
everywhere
in this loop
everywhere
everywhere
everywhere
everywhere
Good to know
- On every Run
- Peeks update each time the code runs, as you type too.
- Node and Web
- Peek works in Node Snippets and in web pages alike.
- Never written in
- The value is drawn beside the line. Copying code copies the comment, not the value.
- Long values, cut
- A value longer than 60 characters is cut short. Hover it to see all of it.
Next time you add a console.log, try //? instead.
Not a trial: it doesn’t expire.
Windows: coming later