我正在尝试制作一个循环对象的 for 循环,并且应该分别记录仪器的适当值, 但是我在执行这个时遇到了这个未知错误:
gge = true;
for (var ins in instruments) {
if (gge) {
this_ = ins;
console.log(instruments[this_]);
}
};
执行此脚本会导致此错误..
Uncaught TypeError: Illegal invocation
仪器对象是http://pastebin.com/tRzvpwgU
谁能帮忙解决这个问题??或解释为什么会这样?
最佳答案
我试过了..
console.log(JSON.stringify(instruments[meow]));
以某种方式将其串起来可以消除错误。
关于javascript - 未捕获的类型错误 : Illegal invocation when looping through object,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32112371/