frontEnd_book icon indicating copy to clipboard operation
frontEnd_book copied to clipboard

以下代码输出什么

Open hanyueqiang opened this issue 3 years ago • 1 comments

try {
    (async function() { a().b().c() })()
} catch (e) {
    console.log(`执行出错:${e.message}`)
}

hanyueqiang avatar Apr 09 '21 03:04 hanyueqiang

image

原因:

  • try catch 无法捕获异步错误,a 函数未定义,a is not defined

hanyueqiang avatar Apr 09 '21 03:04 hanyueqiang