2/6 I can't see what's wrong

I don’t know why, but both of these pieces of code are wrong?

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”

var contacts = [bob,mary];


or replace the last line with

console.log = contacts[1].phoneNumber;

For the first, I get the error
“TypeError: Property ‘log’ of object is not a function”

For the second I get the number to print, but the bottom of the page says “Oops, try again. Did you remember to print out mary’s phone number?”

What am I doing wrong here?

my code is letter for letter with yours and I’m not receiving an error :confused: I wish I could be some kind of help to you but alas that seems not to be the case.

1 Like

console.log("(650) 888-8888") hope that helps.

There are a lot of ways you can cheeky the lesson to make it work.

you could even make it:


But I’m pretty certain there’s no error otherwise in his code.

This is the line that is producing the error message:

console.log = contacts[1].phoneNumber;

because the above statement overwrites the console.log() method with a value so it is no longer a function. This will require a page refresh to restore JavaScript to normal. Be sure to Submit first so your code is saved before refreshing.

After refreshing,


Turns out the browser just was deciding not to work for whatever reason, even with a reload and restart. Didn’t change anything from my code above and it worked fine. I guess I didn’t sacrifice the goat on the right night to get the computer to work like it’s supposed to, haha.


you are very resourceful. lol :smile: