What's wrong with my code?


#1

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);
}

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


#2

What's it doing differently from what you want? Start by identifying what is different from what you want!


#3

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