Level 7

A timer inside a timer

One timer sets another while it runs. Where does the new one go?

setTimeout(() => {  console.log('outer');  setTimeout(() => console.log('inner'), 0);}, 0);setTimeout(() => console.log('second'), 0);

1. Predict the output

Tap the lines in the order you think they print.

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