#4 Listing Everybody


#1

Hello, I am stuck on this exercise, and I cannot get my head around as to why it is wrong, please help 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 = [bob, mary];

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

var list = function(){
var contactsLength = contacts.length;
for (var i=0, i < contactsLength, i++){
printPerson(contacts[i]);
};
};
list()

This is the error message:
SyntaxError: Unexpected token <


#2

Hi this line

for (var i=0, i < contactsLength, i++)

you should change every , with ;


#3

Oh yes, I didn't notice that, thank you :slight_smile: