Why you are creating variable search and in text they want function


#1


https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/7

This works when I tested it and it showing me an error for "Steve".

function search(name){
    var name=name.toLowerCase(); 
    for(var i in friends){
      if(i===name){
      console.log(friends[i]);
      break;}
      else i++;
    }
}


#2

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