Stuck on 6. We made a friend!


#1

https://www.codecademy.com/courses/building-an-address-book/0/6

Can someone please tell me what is wrong with my code? I keep getting the error: "ReferenceError: contact not defined"

function add(firstName, lastName, email, phoneNumber) {
    contacts[contacts.length] = {
        firstName: firstName,
        lastName: lastName,
        email:email,
        phoneNumber: phoneNumber
    };
}


#2

This is not your full code, I'm guessing the error is somewhere else in the code so please paste in all of your code


#3

The [contacts.length] isn't necessary your code will still run properly without it and as @zainabrawat has just said we need to see your full code so we can help you. :slight_smile:


#4

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