Which one is the correct version?... because both are running. I think the purpose of the exercise and the hint tilt towards the first option


#1



https://www.codecademy.com/courses/building-an-address-book/0/2?curriculum_id=506324b3a7dffd00020bf661#


no errors found


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);

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(mary.phoneNumber);


#2

Both are correct. But the exercise is hinting towards the first one.

Having an array with the objects gives you the possibility to loop over the objects (bob and marry) which is very useful for the exercises to come