Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

以下代码输出什么 #47

Open
hanyueqiang opened this issue Apr 9, 2021 · 1 comment
Open

以下代码输出什么 #47

hanyueqiang opened this issue Apr 9, 2021 · 1 comment
Labels

Comments

@hanyueqiang
Copy link
Owner

try {
    (async function() { a().b().c() })()
} catch (e) {
    console.log(`执行出错:${e.message}`)
}
@hanyueqiang
Copy link
Owner Author

image

原因:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant