Skip to content

Instantly share code, notes, and snippets.

@happymishra
Last active June 13, 2019 18:20
Show Gist options
  • Save happymishra/fac744d66954b83f3eecbc42495e1a25 to your computer and use it in GitHub Desktop.
Save happymishra/fac744d66954b83f3eecbc42495e1a25 to your computer and use it in GitHub Desktop.
function printStatement() {
console.log("I will be printed after 0 milliseconds")
}
setTimeout(printStatement, 0)
console.log("Still, I will be executed first")
/* Output:
Still, I will be executed first
I will be printed after 0 milliseconds // After 0 millieconds
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment