Games Node.js Loop Quest Alarm clocks
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…
- 2…
- 3…