只要记住一句话:
// 异步任务都是等脚本里所有的同步任务执行完才执行的 setTimeout(function () { console.log('我是异步任务'); },0) console.log('我是同步任务');
输出: