0

有时我会收到类似错误的错误。为什么会出现?

4

1 回答 1

0

如果您尝试访问未定义值的属性,就会发生这种情况。例如:

var test; // test is now undefined, typeof(test) would return "undefined"
test.myPropertyName // => throws 'Uncaught TypeError: Cannot read property 'undefined' of undefined'

因此,听起来您正在尝试使用未初始化的变量执行操作。

于 2016-02-17T11:23:27.500 回答