When I execute the three lines below, in order, they output in the order 3
, 1
, 2
. Should the order not be 3
, 2
, 1
, since the first line has a longer delay than the second (1ms vs. 0ms)?
setTimeout(() => console.log('1'), 1)
setTimeout(() => console.log('2'), 0)
console.log('3')