var contacts = {
'addressBook' : [
{
'name': 'hillisha'
'email': 'hill@example.com',
},
{
'name': 'neil'
'email': 'neil@example.com',
},
{
'name': 'brian'
'email': 'brian@example.com',
},
{
'name': 'matt'
'email': 'matt@example.com',
},
{
'name': 'mike'
'email': 'mike@example.com',
}
]
};
弹出错误,提示意外的字符串。不知道为什么,需要帮助。我试图运行一个相当简单的循环,但它不需要字符串。
最佳答案
数组内对象的每个“名称”元素后面缺少逗号。请注意,“email”之后的最后一个逗号实际上是可选的。
关于javascript - 我的弦有问题。弹出错误提示 "unexpected string",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27696647/