2. more People


#1

var bob = {
firstName: "Bob",
lastName: "Jones",
phoneNumber: "(650) 777-7777",
email: "bob.jones@example.com"
};
var mary = {
firstName: "Mary",
lastName:"Johnson",
phoneNumber: "(650) 888 - 8888,
email: "mary.johnson@example.com"
};
var contacts= ["bob", "mary"];
console.log(contacts[1].phoneNumber);

Where is the mistake


#2

Remove the quotes around "bob" and "mary" in the contacts array. You're defining them as strings, not the objects that they are.


#3

Thanks works now perfect


#4

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