Skip to content

Instantly share code, notes, and snippets.

@mthenw
Created January 27, 2015 22:25
Show Gist options
  • Save mthenw/7114d5e79d2cbd680093 to your computer and use it in GitHub Desktop.
Save mthenw/7114d5e79d2cbd680093 to your computer and use it in GitHub Desktop.
nextTick vs microtasks
setTimeout(function () {
Promise.resolve().then(function () {
console.log("Promise");
});
process.nextTick(function () {
console.log("nextTick");
});
}, 1);
// OUTPUT node v0.11.13
//Promise
//nextTick
//OUTPUT node v0.11.15
//nextTick
//Promise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment