6. We Made a Friend!


#1

I am going to explode on the syntax soon, absulutly cant find what is wrong... Anyone who can help the error is: SyntaxError: Unexpected identifier


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 < contactsLength; i++) {
		printPerson(contacts[i]);
	}
}
function search(lastName) {
var contactsLength = contacts.length;	
for (var i = 0; i < contactsLength; i++) {
		if (contacts[i].lastName === lastName){
		printPerson(contacts[i]);
	}
	}
};

function add (firstName, lastName, and email, phoneNumber) {
    contacts[contacts.length] = {
    firstName: firstName,
    lastName: lastName,
    email: email,
    phoneNumber: phoneNumber
	}
};
	add('Maire', 'Loirene', 'aemailThatIsGreat@gmail.com', '(650) 999-9999');
	list();


#2

function add (firstName, lastName, and email, phoneNumber)

could you explain and email?


#4

ops wait i got you why the fuk did i write that, or even miss that!


#5