1
console.log("第一步:"+1)
setTimeout(e => console.log("setTimeout:"+2), 0)
new Promise(resolve => {
console.log("第二步:"+3)
resolve("第三步:"+4)
}).then(e => {
console.log(e)
return 5
}). then(e => {
console.log("第四步:"+e)
throw new Error('6')
})
.then(e => console.log('02'+ e))
.catch(err => console.log('yfh' + err . message))
输出结果
第一步:1
第二步:3
第三步:4
第四步:5
yfh6
setTimeout:2
标签:输出,resolve,题目,log,err,常见,new,console,setTimeout
From: https://www.cnblogs.com/user-yi/p/16795956.html