[Solved] Contact List: Tossing in an array


#1


Getting a syntax error, tried fixing it but no luck. Still learning the basics.


var friends = {
    bill: {
        firstName: 'Bill',
        lastName: 'Gates',
        number: '331-244-7538',
        address: ['1 Microsoft Rd.', 'Toronto', 'ON', 'K4P N3L']
        }
    steve: {
        firstName: 'Steve',
        lastName: 'Pup',
        number: '348-284-1938',
        address: ['123 Test St.', 'Toronto', 'ON', 'N5L K4P']
        }
};


#2

address: ['1 Microsoft Rd.', 'Toronto', 'ON', 'K4P N3L']
} // missing , to separate bill and steve property

see comment


#3

Ah, thanks. Not sure why it was expecting a '}'


#4

to close your friends object. (or a , to add another property)


#5

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