Dont know what is wrong ? Building Address book


#1

var bob = {
firstName: "Bob",
lastName: "Jones",
phoneNumber: "(650) 777-7777",
email: "bob.jones@example.com"
};

var mary = {

firstName: "Mary",
lastName: "Johnson",
phoneNumber: "(659) 888 - 8888",
email: "mary.johnson@example.com"

};

var contacts = ["bob","Mary"];

var personContacts = function(){


    for(var i = 1; i < contacts.length;i++){

        console.log(contacts[1] + " " + mary.lastName + " " + mary.phoneNumber );

        };

    };

personContacts();

#2

At least what is the exercice number, if you are not gonna tell us the error you are recieving..


#3

print is : Mary Johnson (659) 888 - 8888

which is right , but error says

'Oops, try again. Make sure that mary is the second object in contacts'

as you can see mary is the second in the array

thanks


#4

Sure. Maybe they meant another Mary though. If you print out the second value of your contacts, do you see a phone number and all that? It's important to read the instructions super-carefully to get a firm idea of what's supposed to happen, otherwise you're shooting in the dark, guessing what's supposed to happen.


#5

thanks wiil check again