Skip to content

Instantly share code, notes, and snippets.

@diogocapela
Created October 22, 2021 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diogocapela/3982f8bf402598e047c04ce1845880aa to your computer and use it in GitHub Desktop.
Save diogocapela/3982f8bf402598e047c04ce1845880aa to your computer and use it in GitHub Desktop.
console.log('L1');
setTimeout(() => console.log('L2'), 0);
new Promise((resolve) => {
console.log('L3');
setImmediate(() => console.log('L4'));
process.nextTick(() => console.log('L5')) // node backend only
resolve();
})
.then(() => console.log('L6'));
console.log('L7');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment