5. Tossing in an Array


Not sure what I'm doing wrong here, any help would be much appreciated :slight_smile:


SyntaxError: Unexpected identifier

var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "(234) 777-7777",
        address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
    steve: {
        firstName: "Steve",
        lastName: "Jobs",
        number: "(432) 555-5555",
        address: ['Two Apple Way', 'Cupertino', 'CA', '94577']


properties of an object literal are comma-separated, if you skip a comma you'll be writing something that the parser doesn't know how to deal with (not valid syntax)


I don't think I left any commas out, did I?


You did


Okay, thanks to @ionatan and some guess 'n check, I figured out that there needs to be a comma after the } that closes out the first contact entry.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.