Why does this result in false?
'use strict';
class InvalidCredentialsError extends Error {
constructor(msg) {
super(msg);
this.name = 'InvalidCredentialsError';
}
}
const err = new InvalidCredentialsError('');
console.log(err instanceof InvalidCredentialsError);
But this returns true:
console.log(err instanceof Error);