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
时间: 2024-10-02 22:10:35