List all contact


#1

help me don't see my fault

function liste() {
var longueurContacts = contacts.length;
for (var i = 0; i < longueurContacts; i++) {
printPersonne(contacts[i]);
}
}


#2

Please post your full code. Also state what error you are getting.


#3

this is all y code

var bob = {
    prenom : "Bob",
    nom : "Jones",
    telephone : "01 23 45 67 89",
    email: "bob.jones@exemple.com"
};

var marie = {
    prenom : "Marie",
    nom : "Johnson",
    telephone : "02 34 56 78 91",
    email: "marie.johnson@exemple.com"
};

var contacts = [bob, marie];

function affichePersonne(personne) {
  console.log(personne.prenom + " " + personne.nom);
}

    function liste() {
    var longueurContacts = contacts.length;
    for (var i = 0; i < longueurContacts; i++) {
        printPersonne(contacts[i]);
    }
    }
    liste();

#4

Hint: You have defined affichePersonne in your code, but are calling printPersonne in the liste function.