setTimeout(0) Is Lying to You (and the Event Loop Can Prove It)
Quick test. No running it, no Googling. What does this print?
console.log('start');
setTimeout(() => {
console.log('timeout');
}, 0);
Promise.resolve().then(() => {
console.log('promise');
});
jsvisualized.hashnode.dev4 min read