Finding that Special Someone


Hi everybody,
I am not sure what I am doing wrong here. And I am a little bit fried.
The error message is:
Oops, try again. It looks like your search function didn't log "Bob Jones" to the console. Did you remember to call search after you defined it?

Thanks in advance for your help.

var bob = {
    firstName: "Bob",
    lastName: "Jones",
    phoneNumber: "(650) 777-7777",
    email: ""

var mary = {
    firstName: "Mary",
    lastName: "Johnson",
    phoneNumber: "(650) 888-8888",
    email: ""

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++) {

/*Create a search function
then call it passing "Jones"*/
function search(lastName) {
	var contactsLength = contacts.length;
	for (var i = 0; i < contactsLength; i++){
        if(contacts[i].lastName === lastName) {
        } else {
            return "There is no such a person in the list";

search("Bob Jones");


when you call the function, you should only provide the surname as argument, given your function compares with the last name from the objects:

if(contacts[i].lastName === lastName)


Good morning all.

It seems that I have found what was wrong from previous posts.