The correct answer is to narrow the type of error, and we’ll look at how to do that, but why is this even necessary? In JavaScript, just about anything can be thrown: The error that is caught truly is unknown. When the error is caught we can narrow the error type by using Once narrowed, gives us intellisense.
Table of contents
Handling errors like a pro in TypeScriptFirst, the basics of errors in JavaScriptEnough of the basics, let’s look at the design patternConclusion6 Comments
Sort: