try {
null.property
} catch (e) {
// this is a TypeError, not ReferenceError
e instanceof TypeError // β true
}Distinguish ReferenceError (undeclared variable) from TypeError (wrong type operation).
You can manually throw and catch a ReferenceError.
Challenge: Throw a ReferenceError and return its .name from the catch block.