title: Why else block is executed even though if condition is true?
body: <p>I was practicing some JavaScript on Codeacademy few minutes ago and I found something confusing. Here is the code:</p>
  
  <pre><code>var friends = {};
  friends.bill = {
    firstName: "Bill",
    lastName: "Gates",
    number: "(206) 555-5555",
    address: ['One Microsoft Way','Redmond','WA','98052']
  };
  friends.steve = {
    firstName: "Steve",
    lastName: "Jobs",
    number: "(408) 555-5555",
    address: ['1 Infinite Loop','Cupertino','CA','95014']
  };
  
  var list = function(obj) {
    for(var prop in obj) {
      console.log(prop);
    }
  };
  
  var search = function(name) {
    for(var prop in friends) {
      if(friends[prop].firstName === name) {
        console.log(friends[prop]);
        return friends[prop];
      }
      else {
        return  "contact not found";
      }
    }
  };
  
  list(friends);
  search("Steve");
  </code></pre>
  
  <p>The problem is that when I pass the string "Steve" as an arg in the search function, it returns the condition "Contact not found" while when I pass the string "Bill" as an arg in the same search function, it displays the contact information.</p>
  
  <p>How is that possible? What am I doing wrong?</p>