#2 bugged or something?


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

i dont see why it doesnt take it
error code is: Oops, try again. Did you remember to print out mary's phone number?
TypeError: console.log is not a function


#2

It should work, try:

console.log(mary.phoneNumber)

which is basically the same thing, except you don't use the index number, you use the name of the contact. If that still doesn't work, you hit a glitch, try a different browser


#3

In your var contacts; aren't bob and mary strings? Shouldn't they be in quotes?


#4

no, they refer to the objects:

var mary = {

#5

Make sure to just print the number, no additive text in console and to write the data correctly, without extra spaces or typos. This worked for me:

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 = new Array();
contacts[0] = bob;
contacts[1] = mary;

console.log(contacts[1].phoneNumber);


#6

I had the same error. For me, writing both statements made it go away. I think that the system is just checking to make sure that you did all of its objectives, and it tells you to print out Bob's number then Mary's.

so try

console.log(contacts[0].phoneNumber);
console.log(contacts[1].phoneNumber);