DEV Community

Discussion on: Custom exceptions with JS

danielpdev profile image

try-catch will impact your performance only if you actually throw exceptions.

  1. Performance loss when exception is thrown:
  2. No performance loss if no exception is thrown:

I'm not saying that you should not use try-catch at all, but like in the examples above actually throwing an exception can be easily avoided.

Thread Thread
damxipo profile image
Damian Cipolat Author

Nice, thanks for the links provides very useful information. I will be investigating about this.