A happy duck handling his errors
A duck handling its errors

Checking If A Value Is An Error In JavaScript

Carlous Fahmi

--

Given the dynamically typed nature of JavaScript, a problem you may run into with building error handling into your application is how to tell if a given value actually is an error.

Take the following snippet of code:

var returnedValue = someFunction();

someFunction() may return an error which was previously caught from within the…

--

--

Carlous Fahmi
0 Followers

Full Stack Software Developer based in London.