Lesson 2, it says make sure mary is the second object in contacts


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


#2

Are you creating an array with "bob" and "mary" ? Did you mean to use bob and mary as the elements? Remember what the assignment calls for. Make mary the 2nd element.

You may find this link on arrays useful:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array


#3

It says to create an array called contacts and put bob in first and then mary. In my past exercises the elements = the strings inside the array.


#4

I found my error actually thanks.


#5

Could you tell what was the error?
I have the same problem.
Thanks


#6

The error happened when I tried to log mary but within my contacts array I had "mary", and "bob". I made them into strings when I shouldn't have.


#7

Thanks! It was driving me crazy!


#8

Yea me 2, the small problems are the most annoying really. And when you ask for help sometimes on these forums people just say figure it out yourself. I can see if my syntax is wrong but if its just something small like quotations are parenthesis they can just tell you what you did and why it is wrong. But oh well.


#9

Yeah right, It took an hour and a half to find a round bracket last night! I went to bed feeling a bit depressed :frowning:
I need much more practice!


#10

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