Level 10

An alarm that repeats

setInterval every 10ms, cleared on the third run.

let n = 0;const id = setInterval(() => {  n++;  console.log('tick ' + n);  if (n === 3) clearInterval(id);}, 10);

1. Predict the output

Tap the lines in the order you think they print.

  1. 1…
  2. 2…
  3. 3…