5. Tossing in an Array


#1

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

https://www.codecademy.com/en/courses/javascript-beginner-en-3bmfN/0/5?curriculum_id=506324b3a7dffd00020bf661

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']
    }
};


#2

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)


#3

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


#4

You did


#5

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.


#6

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