Stuck on 6. We made a friend!


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,
        phoneNumber: phoneNumber


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


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:


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