DEV Community

loading...

What's the order of execution?

318097 profile image Mehul Lakhanpal Originally published at codedrops.tech ・1 min read
console.log('1');
setTimeout(() =>console.log('2'), 0);
Promise.resolve().then(() => console.log('3'));
console.log('4');
Enter fullscreen mode Exit fullscreen mode

Thanks for reading πŸ’™

Follow @codedrops.tech for daily posts.

Instagram ● Twitter ● Facebook

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript

codedrops.tech

Discussion (0)

pic
Editor guide