setTimeout(function(){
console.log('1')
});
new Promise(function(resolve){
console.log('2');
}).then(function(){
console.log('3')
});
console.log('4');
结果是 2 4 3 1
image.png
网友评论