Elegant error handling with the JavaScript Either Monad

698 Views

Let's talk about how we handle errors. JavaScript provides us with a built-in language feature for handling exceptions. We wrap problematic code in try...catch statements. This lets us write the 'happy path' in the try section, and then deal with any exceptions in the catch section. This is not a bad thing.