onClick
2022年5月1日小于 1 分钟
onClick
Question
What does the code snippet to the right output by console.log
?
Snippet
console.log(1)
document.body.addEventListener('click', () => {
console.log(2)
})
Promise.resolve().then(() => {
console.log(3)
})
setTimeout(() => {
console.log(4)
}, 0)
console.log(5)
document.body.click()
console.log(6)