I find it difficult to apply such patterns (especially e instaceof <class>) because in JS it's not obvious what the errors that you have to catch and handle could be. In other language such as C#, Java, etc. the thows signature gives you this information, but in JS you have to hope it's documented somewhere.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I use it all the time. You can also use it to test the conditions of anything you like. Often makes for more readable code
I find it difficult to apply such patterns (especially
e instaceof <class>
) because in JS it's not obvious what the errors that you have to catch and handle could be. In other language such as C#, Java, etc. thethows
signature gives you this information, but in JS you have to hope it's documented somewhere.