Search function


#1

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

This is the message it gives me:
Oops, try again. Did you create a function called search?

The function is created in the top line yet it is saying that I haven't created it, what's going on?


#2

The object in this case is, friends.


#3

Thanks for you help, appreciate it :grin:


#4

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