Question 7 i am confused as to what is wrong here


#1

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number:"02086565677",
address: ["54 Elgin Road"]
},
steve: {
firstName: "Steve",
lastName: "Blake",
number: "02089675476" ,
address: ["60 sandown Road"]
}
};
var list = function(friends){
for (var firstName in friends) {
console.log(firstName);
}
};
var search = function(friends) {
for(var key in friends) {
if(friends[key].firstname === name) {
console.log(friends[key]);
return friends[key];
}
}
};
list(friends)
search("steve")


#2

@darrius96,

You are searching for the firstName
and define these as
firstName: "Bill",
firstName: "Steve",


#3

@darrius96,

You will have to change the parameter of your search =function=
from friends into name


#4

@darrius96,

### the FUNCTION talk

var myFunc = function( param1, param2) {
       //Begin of  anonymous FUNCTION-BODY
       //VARIABLE -myFunc- has an -anonymous function- assigned
       //this -anonymous function- has 2 PARAMETERS param1 and param2
       //param1 and param2 PARAMETERS are used 
       //as -local- VARIABLES throughout the FUNCTION-BODY

      console.log( param1 + " and " + param2 ) ;

      //End of anonymous FUNCTION-BODY
};

If you want to call/execute the anonymous function
you will have to add a pair of parentheses to the variable myFunc
like
myFunc();
As the anonymous function was defined
as having 2 parameters
you have to provide 2 arguments
in our case 2 string VALUES "Alena" and "Lauren"
like
myFunc("Alena","Lauren");

some quotes from the outer-world:

**argument is the value/variable/reference being passed in,
parameter is the receiving variable used within the function/block**

OR

**"parameters" are called "formal parameters",
while "arguments" are called "actual parameters".**


#5

at the bottom you are searching for "steve" but u have to search for "Steve" with caps. Case sensitive because at top it is caps.