7. Don't know what's wrong help!


#1

I need help with some code help!

var friends = {
 steve: {
  firstName: "Steve",
  lastName: "Jobs",
  number: "1800 818182",
  address: ["22 broadwater drive","Saratoga","NSW","2251"]
  },
bill: {
  firstName: "Bill",
  lastName: "Laslo",
  number: "1800 900 800",
  address: ["1 broadwater drive","Saratoga","NSW","2251"]
};

var list = function (friends){
    for (var i in friends) {
        console.log(i);
        var search = list;
        
    }
    
};
    
var search = function(name) {
    for (var x in friends) {
        if (friends[x].firstName === name) {
            console.log(friends[x]);
            return friends[x];
        }
    }
    
    
}

console.log(search);

#2

Try,

search("Bill");

or

search("Steve");

#3

He meant

Instead of search"Steve");


#4

Got it. Thanks for watching.


#5

No Problemo. :relieved: