Keep getting "did you create a function called 'search'" error


#1

I'm on Javascript part 7, creating a search function to search the address book I created. I can't understand why I keep getting an error message saying "Did you create a function called search?"

Even if I did something wrong, I thought I at least created a function called search in the following code:

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

I even copied some good code out of the blog, ran it, it was fine, then I just copied it verbatim and it still gives me this error.


#2

@ealfpl,

Have a close look at

firends