[TypeScript@2.5] Omit catch error block if not needed
Posted Answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[TypeScript@2.5] Omit catch error block if not needed相关的知识,希望对你有一定的参考价值。
From [email protected], you can omit catch error block.
Before:
try { throw new Error(‘whatever‘); } catch(err) { console.log(err) }
Now:
try { throw new Error(‘whatever‘); } catch { console.log("error happened") }
It is just a syntax sugar, if you are not trying to do error handling
以上是关于[TypeScript@2.5] Omit catch error block if not needed的主要内容,如果未能解决你的问题,请参考以下文章
[TypeScript] Type check JavaScript files using JSDoc and Typescript 2.5
为啥`-fno-omit-frame-pointer` 会干扰 ASAN?