More People exercise


#1

I think my code looks right but I keep getting the following error: "Did you remember to print out Mary's phone number?" which it clearly is doing each time. I need help please.

Edit: I have also tried removing the "=" after console.log but then it tells me "console.log is not a function".


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


#2

Wow this exercise is !@!$(!(^!($!. It would not be satisfied until I removed the spaces from Mary's phone number even though I originally entered it exactly as provided. Sooo dumb..


#3

it should be console.log(contacts[1].phoneNumber); instead of console.log = (contacts[1].phoneNumber);


#4

Correct. The confusion and frustration was coming from the error that was being displayed even with the appropriate formatting. (See Edit text)


#5

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