5. Tossing in an Array syntax problem


#1


var friends = 
{
    chandler: 
    {
        firstName: "Chandler",
        lastName: "Bing",
        number: "12345678",
        address: ['Flat 15', 'New York City', 'USA']
    }
     joey: 
    {
        firstName: "Joey",
        lastName: "Tribbiani",
        number: "87654321",
        address: ['Flat 15', 'New York City', 'USA']
    }   
};

On the line where 'joey:' is, I've got a red cross syntax error saying "Expected '}' to match '{' from line 2 and instead saw 'joey'. Missing semicolon. Expected '(end)' and instead saw ':' "
If I remove Joey's entry completely the error disappears.
And ideas? Thanks


#2

here:

    }
     joey:

there is a comma missing after your closing curly bracket to separate the properties/keys of friends object


#3

That's solved it thanks! All that for one little comma, the joys of coding!


#4

#5

yea, this can suck :stuck_out_tongue: