Can someone tell me what's wrong?


#1

Can I have some help, plz? Don't tell me the correct code, I would just like to know what I did wrong, and some examples on some terms I may have used incorrectly? Thnx!

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

function printPerson(person){
console.log(person.firstName + " " + person.lastName);
}

function list(){
var contactsLength = contacts.length
for(x = 0; x === contacts.length - 1; x++){
printPerson(contacts[x])
}}

list()


#2

This should be an inequality, not an identity. It is a changing state that does not exceed the range given by the length of the array. Instead, have it read,

x < contactsLength;     // use the variable you created

#3

Cool. Thnx for the help.