7. Search for a friend :/


#1



I don't know what is wrong in this code :rage:

var friends = {};
friends.bill = {
    firstName: 'bill',
    lastName: 'abo bill',
    number:50,
    address: ['One Microsoft Way','Redmond','WA','98052']
    };
friends.steve = {
    firstName: 'steve',
    lastName: 'abo steve',
    address: ['One Microsoft Way','Redmond','WA','98052']
    };
var list = function(name){
    for ( var key in name){
        console.log(key);
        }
    };
var search = function(name){
    for ( var key in friends){
        if(friends[key].firstName === name) {
            console.log(friends[key]);
            return friends[key];
            }
        }
    };
list(friends);
search('steve');


#2

Your last name on each of the people is wrong it should be Gates and Jobs and the first names should be capitalized.

and the last line of code steve should be capitalized.

this is the number for Bill number: "(206) 555-5555",

and this is the number for Steve number: "(408) 555-5555",

I hoped that worked for you


#3

Thanks legendsoftomorrow it's worked :smile: