36

慎用try catch

 5 years ago
source link: https://juejin.im/post/5c17dad7f265da611510b63f
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 ECMA-262第3版引入了try catch语句,作为JavaScript中处理异常的一种标准方式。基本的语法如下所示。 但是在前端js代码中很少看到try catch语句,并不是所以代码都需要加try catch来作得不偿失的“保险”,下面来分析作为

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK