4. my browser freeze with my solution


#1

When I click submit my browser freeze like I do a infinite loop. Someone can help me with that plz

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(var i = 0; i < contacts.length; i++) {
        console.log(printPerson(contacts[i]));
        };
list();        
    }

#2

You're calling the list function from within the function. Move list(); to below the closing } of your function