Finding that special someone


/*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){
        } else{
            console.log("Not found");


Could you post your full code please?


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