I am not sure where my code is wrong, I am pretty sure I checked everything


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

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

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

list();


#2

did you mean contactsLength?


#3

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