Facing trouble while adding object to array


#1


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


i am not able to add the new created object in the array.error message says that there is an invalid or unexpected token.


Replace this line with your code. 
var add=function( firstName,lastName,phoneNumber,email)
{
    var firstNamez=
    {
        firstName1:firstName,
        lastName1:lastName,
        phoneNumber1:phoneNumber,
        email1:email
    };
}
contacts[contacts.length]=firstNamez;
add("drae","parker",9865448654,asd@gmail.com);


#2

Try surrounding all of the values in quotes, as the email isn't recognized as Boolean or integer


#3

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