Search code examples
javascriptbackbone.jserror-handlingunderscore.js

Why don't JavaScript libraries use error handling


I have looked through underscore.js and backbone.js, both two very popular libraries and noticed that they don't use error handling (try, catch, exception).

What is the reason for this decision?


Solution

  • Actually when you write quality javascript code you don't really need try/catch. Exceptional logic is handled through if conditions and error handlers instead of catching exceptions at runtime.