Search for a Friend



I am stuck with this problem. The instruction is: Define a function search that takes a single argument, name. If the argument passed to the function matches any of the first names in friends, it should log that friend's contact information to the console and return it.

The code that I have written is:

var search= function (name){
for (var name in friends){
if (name===firstName){
console.log (friends)}
else {
return friends}
search= ("steve");
It keeps asking Did you create a Function called search?


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