Why the suggestion to use an error's name rather then instaneof and the error's class?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
e instanceof Error
or: e instanceof MyError
why does toString() have anything to do with this? const e = new Error('bad stuff happened')
e.name = 'MyError'
without actually creating a MyError class to check with instanceof.Which popular libraries do this?
If it's just in a few places, it should be handled specifically, and use sane choices in other places.