0

Does a try catch block slow down code execution?

I have read something online where it does (because it creates additional objects maybe?)?

I could create a performance test / for loop but I don't know if that would absolutely answer the question if there are other factors.

I'm referring to Javascript in the browser and node js applications or the JavaScript engine behind them.

1.21 gigawatts
  • 16,517
  • 32
  • 123
  • 231
  • The try part does not slow down code. Thrown errors slow down code regardless if you catch them or not so catch them if you don't want your program to terminate/crash. – slebetman May 15 '23 at 22:19

0 Answers0