Created
July 23, 2018 12:49
-
-
Save sandeep1995/cca2ab69f38aab0ab8e00706f86cd6c5 to your computer and use it in GitHub Desktop.
Guess the output of the following javascript code snippet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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