js 宏微任务执行顺序
一,直接打开地址查看
https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/
console.log('script start'); setTimeout(function () { console.log('setTimeout'); }, 0); Promise.resolve() .then(function () { console.log('promise1'); }) .then(function () { console.log('promise2'); }); console.log('script end');
输出 script start 》script end》 promise1 》promise2》setTimeout