[4/6] Printing the double


#1

Hello, this code goes through the editor approving the correct, though it prints two times the same contacts to the console. What is actually wrong? How to make it print only the contacts for one time?

var contacts = [bob, mary];

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

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

list(contacts);


#2

I actually have no idea. Just noticed mine does that too :smiley:. Clueless me.

Ohhh.

Try taking out this:

list(contacts);


#3

The output is duplicated because the lesson checker is running the code to test it. You may ignore the secondary output.