function asyncPrint (message) { console.log(message) }function pro (message, miniSecond) { return new Promise((resolve, reject) => { setTimeout(asyncPrint, miniSecond, message) }) }async function result() { console.log('before') await pro('printMMEE', 1000) console.log('after') console.log('sync code') } result()
请问为什么这两行代码在await之后就不执行了呢?
console.log('after') console.log('sync code')
人到中年有点甜
HUX布斯
相关分类