据说node7.0已经支持async/await,那么下面的代码为什么运行不了?
var sleep=function(time){
return new Promise(function(resolve,reject){
setTimeout(function(){
resolve('ok');
},time);
});
};
async function start(){
let result =await sleep(3000);
console.log(result);
}
start();
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
小伙看你根骨奇佳,潜力无限,来学PHP伐。