Difference TypeError and ReferenceError
问题 What's the differnce between TypeError: ... is undefined and ReferenceError: ... is not defined ? 回答1: A ReferenceError occurs when you try to use a variable that doesn't exist at all. A TypeError occurs when the variable exists, but the operation you're trying to perform is not appropriate for the type of value it contains. In the case where the detailed message says "is not defined", this can occur if you have a variable whose value is the special undefined value, and you try to access a