Can I use a try/catch in JavaScript without specifying the catch argument/identifier?
问题 I was wondering if there is a way to not specify the argument when doing a JS try/catch. Every time I try this though, the try/catch doesn't work. The working version: try{ //Breaking code } catch(e){ //Nothing happens here } What I have in mind (No 'e'): try{ //Breaking code } catch(){ //Nothing happens here } 回答1: You just can't. The spec says that there must always be an identifier inside parens after catch . 回答2: Optional catch binding in 2019 Node.js In Node.js, this feature is called