Finding that special someone


#1

/*Create a search function
then call it passing "Jones"*/

Need help. my code gives this error:

ReferenceError: contactsLength is not defined

where do i need to define it again?

var search = function(lastName){
    var contactsSearch = contactsLength;
    for(var i=0; i<contacts.length; i++){
        if (contact[i].lastName === lastName){
            printPerson(contacts[i]);
        } else{
            console.log("Not found");
        };
    };
};
search("Jones");

#2

Could you post your full code please?


#3

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