Skip to content

Instantly share code, notes, and snippets.

@sandeep1995 sandeep1995/main.js
Created Jul 23, 2018

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.