Last active
December 24, 2018 18:58
-
-
Save rajikaimal/6cca94b1212aac61d5544aaf31af3955 to your computer and use it in GitHub Desktop.
setTimeout vs seteImmediate
This file contains hidden or 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
setTimeout(() => { | |
console.log('SetTimeout callback'); | |
}, 0); | |
setImmediate(() => { | |
console.log('SetImmediate callback'); | |
}); | |
// Output: | |
// SetImmediate callback | |
// SetTimeout callback | |
// OR | |
// SetTimeout callback | |
// SetImmediate callback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment