"Search for a Friend" Syntax Error?


#1

When I enter this code, apparently I get a syntax error. I looked over it many times and I can't see anything wrong. Help!

var friends = {
Bill : {
firstName : "Bill",
lastName: "Robinson",
number: "(333) 111-2222",
address: ['A42', "Willoughby Way", "Sydney"],
},
Steve: {
firstName : "Steve",
lastName: "Harrison",
number: '(555) 333-4444',
address: ['2143', "Virginia", 'USA'],
}

};
var list = function(friends) {
for (var person in friends) {
    console.log(person)
}

}
var search function(name) {
for (var key in friends) {
if (friends[key].firstName === name) {
console.log(friends[key]);
return friends[key];
}
}
}
list(friends);
search("Bill");


#2

the order of the word is wrong. Review the correct syntax for defining functions in JavaScript.


#3

Thank you for pointing that section out—it turns out that I was just missing the "=" sign!