MenuStart here / Your first Run

Docs / Start here

Your first Run

Open the Node.js Starter, run it, and read what the code did.

On this page

Open a Starter

  1. Click + at the end of the tabs.
  2. Pick Node.js.

A new tab opens with the Starter’s demo in it. You can also pick a Starter on the Home screen, which JSpark shows when no tab is open.

The + menu lists the Starters. Node.js runs plain JavaScript or TypeScript on Node.

JSpark keeps up to 3 tabs open. To open another, close one first. JSpark+ keeps as many open as you like.

Run it

You don’t have to do anything: a moment after the tab opens, the demo runs by itself, because Run as you type is on. To run it again at any time, press ⌘↵ or Ctrl+Enter.

The bolt at the top of the rail turns Run as you type on and off. When it is off, a Run button is above it, and the code runs only when you ask. See Run and Run as you type.

Read the console

The console, beside the code, shows what the Run printed: total 53 and highest 30. The footer under both says how the Run ended.

The console shows what the demo printed, and → 53 beside the loop is a Peek.

The //? at the end of total += score is a Peek. After the Run, the value that line came to is drawn beside it. See Peek.

If the code throws, the console shows the error, with a link to the line it came from.

Change a line

Change a number in scores, for example 4 to 40. A moment after you stop typing, the Snippet runs again, and the console says total 89 and highest 40.

Until then, the output on screen is from the code before your change, and the footer says code changed since.

While you type, the output is still the last Run's; a moment after you stop, the new answer arrives.

Clear the demo and write your own code in its place. It runs the same way.

The pictures show JSpark on a Mac. On Windows, the window looks a little different and uses Ctrl for ⌘, but everything works the same way.

Esc

Type to search every docs page.