![](https://box.kancloud.cn/8da83db3803f78f740f7b0761a6df53d_795x441.png)
一个检测题:
```
console.log('main1');
process.nextTick(function() {
console.log('process.nextTick1');
});
setTimeout(function() {
console.log('setTimeout');
process.nextTick(function() {
console.log('process.nextTick2');
});
}, 0);
new Promise(function(resolve, reject) {
console.log('promise');
resolve();
}).then(function() {
console.log('promise then');
});
console.log('main2');
```
![](https://box.kancloud.cn/193c3b388cf877a6bb64ebfb2209c0f7_329x274.png)