setTimeout(0ms)
2022年5月1日小于 1 分钟
setTimeout(0ms)
Question
What does the code snippet to the right output by console.log
?
Snippet
// This snippet's result may vary on browsers
setTimeout(() => {
console.log(2)
}, 2)
setTimeout(() => {
console.log(1)
}, 1)
setTimeout(() => {
console.log(0)
}, 0)