Instantly share code, notes, and snippets.

Embed
What would you like to do?
Guess the output of the following javascript code snippet.
const log = (msg) => console.log(msg);
log('First');
Promise.resolve().then(() => {
log('From promise');
})
requestAnimationFrame(() => {
log('From animation frame');
})
setTimeout(() => {
log('From set timeout 0');
}, 0)
setTimeout(() => {
log('From set timeout 15');
}, 15)
log('Last');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment