Can some1 explain me what that part in the bottom does?


#1

var list = function (name) {
for (var key in friends) {
console.log(friends);
}
};
list(friends);
var search = function (name) {
for (var key in friends){
if(friends[key].firstName = name){
console.log(friends[key]);
return friends[key];
}
}
};
Mainly i would like for (var key in friends) to be explained... i mean what does it do? =.= Change like the name of variable friends?


#2

did you take the course from the beginning? if not try to go through each module. All the questions you ask have been taught


#3

Yeah... and i didnt get it when they explained it in the middle to be honest. =.=


#4

Here
w3schools should give you a fast briefing on it

and

for-in loops


#5

Wayy to complicated for me. Do you happen to know the part where for in loops were introtuced? o.o If no than... all I can hope is for them to start making sense in the long run.