Syntax error after property line


#1

once more, I can not find my error, have checked other answers and it looks like there are 3 ways to do this, but I get nearly the same syntax error.
thanks


#2

var bob = {
firstName: "Bob",
lastName: "Jones",
phoneNumber: "(650) 777-7777",
email: "bob.jones@example.com"
};

var mary = {
firstName: "Mary",
lastName: "Johnson",
phoneNumber: "(650) 888-8888",
email: "mary.johnson@example.com"
};

var contacts = [bob, mary];

function printPerson(person) {
console.log(person.firstName + " " + person.lastName);
}

function list() {
var contactsLength = contacts.length;
for (var i = 0; i < contact.length; i++) {
printPerson(contacts[i]);
}
}
function search(lastName) {
for (var i=0;i if (lastName===contacts[i].lastName){
printPerson (contacts[i])}
else {console.log ("None");
}
}
}

search ("Jones");
/*Create a search function
then call it passing "Jones"*/

var add = function (firstName,lastName,phoneNumber,email){
contacts[contacts.length] = {
firstName: firstName;
lastName: lastname;
phoneNumber: phoneNumber;
email: email;
};
};
add ( "denny", "mix", "222-222-2222","dkm@ms");
list();


#3

Even though I am not sure that this is the problem, I know that this is a problem. On problem, though. There may be more. For now, I want you to look closely at the code I quoted from you.

Look closely at the word "contacts" especially.


#5

@dkmixer
firstName: firstName;
lastName: lastname;
phoneNumber: phoneNumber;
email: email;

This section here needs to have the semi-colons changed to commas. Should look like:
firstName: firstName,
lastName: lastname,
phoneNumber: phoneNumber,
email: email

The final row has no comma or punctuation at the end.