7. Search for a friend


I've been trying to figure out what's wrong with my search function and have been turning up nothing. So I tested it by taking the code from the completed project they give at the beginning. It still doesnt pass even though it prints the information. Is this lesson faulty?

var search = function(name) {
  for(var prop in friends) {
    if(friends[prop].firstName === name) {
      return friends[prop];



your code looks fine. I experienced a similar problem and iI fixed it saving my code and refreshing the page.


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