Reputation: 1
var contacts = {
'addressBook' : [
{
'name': 'hillisha'
'email': '[email protected]',
},
{
'name': 'neil'
'email': '[email protected]',
},
{
'name': 'brian'
'email': '[email protected]',
},
{
'name': 'matt'
'email': '[email protected]',
},
{
'name': 'mike'
'email': '[email protected]',
}
]
};
error pops up saying unexpected string. Not sure why and need help. I am trying to just run a rather simple loop and it isn't expecting string.
Upvotes: -1
Views: 43
Reputation: 5917
You are missing your commas after each 'name' element on the objects inside the array. Note that that the last comma, after 'email', is actually optional.
Upvotes: 2