1.参考执行结果
setTimeout(function () { console.log('执行定时任务'); }); new Promise(function (resolve) { console.log('马上执行for循环'); for (var i = 0; i < 1000; i++) { i == 99 && resolve(); } }).then(function () { console.log('执行then函数'); }) console.log('代码执行结束');