Search a friend


what’s wrong in my code

var recherche = function (pNom) {
for (var prenom in pNom) {
if (pNom[prenom] === amis) {
return pNom[prenom];


I don’t know French, but from what I can gather:

  1. Your for-in loop should loop over friends (amis?) array as friend(ami?).
  2. You have to check if friend[first name] (ami[prenom]?) equals the argument (pNom)

Hope that helps!