6/6 Oops, try again. It looks like there are still only two items in the contacts array


#1

hey guys it's me again.
I can't run the add function and create an extra contact in my contacts array.
I've been trying to run the push on my contacts array but it won't seem to work.
Could someone please tell me where my mistake is at?
Here's the code:

var add = function(firstName, lastName, phoneNumber, email){ var newConatct = {
firstName: firstName,
lastName: lastName,
phoneNumber: phoneNumber,
email: email
}
contacts.push(newContact);
};

add ["Yasser","Lotfy","017684334428","yasser@lotfy.com"]


#2

I did it like this and it worked :smile: good luck!!

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

add("Cecil", "Palmer", "VOID", "Scream really loud @ all cats are cute");
list();


#3

add ["Yasser","Lotfy","017684334428","yasser@lotfy.com"]
    ^                                                  ^

try changing those

to:

add ("Yasser","Lotfy","017684334428","yasser@lotfy.com")