function delayDate(time) {
return new Promise((resolve, reject) => { setTimeout(() => { console.log(‘开始执行‘) resolve("success"); }, time); }); } await delayDate(2000) console.log(‘结束执行‘)
2022-05-20 20:23:52
function delayDate(time) {
return new Promise((resolve, reject) => { setTimeout(() => { console.log(‘开始执行‘) resolve("success"); }, time); }); } await delayDate(2000) console.log(‘结束执行‘)
下一篇:五.二叉树