What is the correct syntax when extracting an object property from an array?
example
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 contact = [bob, mary];
console.log(contact[1.phoneNumber]); // <-- Need help here to print phoneNumber!
So when I want to print out the phoneNumber property from mary object using the contact array what is the correct syntax?