6. What is the mistake?


#1


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


I don't know but I must be having something wrong in my code ..could anybody check please ?
the error message in the console is this : (ReferenceError: phoneNumbeer is not defined)


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]);
	};
};

/*Create a search function
then call it passing "Jones"*/
var search = function (lastName) {
    var contactsLength = contacts.length;
    for (var i = 0 ; i < contactsLength ; i++) {
        if (contacts[i].lastName = lastName) {
            printPerson(contacts[i]);
            };
        };
    };
search("jones");
function add (firstName , lastName , email , phoneNumber) {
    contacts[contacts.length] = {
    firstName : firstName,
    lastName : lastName,
    email : email,
    phoneNumber : phoneNumbeer
        }
    };
add("Karam ElRahman" ,"Ahmed" , "Kiroskady@gmail.com" , "121511138361");
list();


#2

Have a look at your spelling ^

You have phoneNumbeer it should be phoneNumber


#3

oh .. lol thanks alot sir you are a life saver :smiley: ... can't imagine that this was the mistake tho :smiley:


#4