首页 > 编程语言 >node38-anysc关键字

node38-anysc关键字

时间:2022-09-02 21:56:58浏览次数:75  
标签:function node38 console log 关键字 anysc fn

 

//只能出现再异步函数中 暂停异步函数得执行
async function fn() {
    throw '发生勒一些错误';
    return 123;
}
//console.log(fn())
fn().then(function(data) {
    console.log(data);
}).catch(function(err) {
    console.log(err);
})

 

标签:function,node38,console,log,关键字,anysc,fn
From: https://www.cnblogs.com/yao-655442/p/16651449.html

相关文章