Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
button.addEventListener('click', () => {
Promise.resolve().then(() => console.log('P1'))
console.log('L1')
})
button.addEventListener('click', () => {
Promise.resolve().then(() => console.log('P2'))
console.log('L2')
})
click button
L1 P1 L2 P2
button.click()
L1 L2 P1 P2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment