6. Need a new set of eyes to help find the syntax error please


#1



https://www.codecademy.com/courses/building-an-address-book/0/6?curriculum_id=506324b3a7dffd00020bf661#


I can't seem to find the syntax error that it keeps telling me exists. Maybe a fresh set of eyes will find it.


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

add("Han", "Solo", "han.solo@outerrimmail.com", "unlisted");
list();

Thanks in advance! :slight_smile:


#2

Never mind. I just had to step away for a moment. It should've been,

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

add("Han", "Solo", "han.solo@outerrimmail.com", "unlisted");
list();

#3

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