使用:
console.log("First Item Author: "+myjson.value.items.0.author);
我收到以下错误:
Object Uncaught SyntaxError: Unexpected number
尝试访问以下对象:
最佳答案
0
不是有效的标识符,不能用作直接属性名称。
相反,使用数组表示法:
items[0].author
关于javascript - 对象未捕获语法错误 : Unexpected number,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18471533/