Steve and his contact info


I'm honestly not sure where it's going wrong. It keeps saying that Steve's info isn't returning even though it is showing in the log. I even commented out console log to see if that was what I was viewing but Steve's info still returned in the window. HOWEVER....I don't see Bill's info.

Replace this line with your code.


updated code. noticed a missing curly bracket.


the url is the same for everyone, please copy paste your code to the forum


var friends = {};
    friends.bill = {
        firstName: 'Bill',
        lastName: 'Bobbins',
        number: '404-234-5678',
        address: ["123 Sesame Street", "Bethlehem", "PA", "54673"],
    friends.steve = {
        firstName: 'Steve',
        lastName: 'Stephanopolus',
        number: '678-987-6543',
        address: ["68 Dragon Lane", "Macon", "GA", "34982"],
        var list = function(friends){
         for(var name in friends){
        var search = function(enterName){
          for(var name in friends){ 
            if (friends[name].firstName == enterName){
                return friends[name];
                    return "No Match!";


a function ends the moment a return keyword is reached, this currently happens in the first iteration of your loop

place return no match outside the loop


So I'm moving the entire else statement outside of the for loop? or just the return "No Match"?


Nevermind! Got it thanks!!!


you can do both, but you can just remove else and then return no match, saves code.


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