setTimeout(() => console.log('1'), 1);
setTimeout(() => console.log('4'), 0);
setTimeout(() => console.log('3'), 2);
setTimeout(() => console.log('2'), 0);
I expected the output to be 4,2,1,3 but the output is 1,4,2,3. How the first setTimeout with delay 1 is getting executed even before 0?