Where did I go wrong with "Unexpected end of input"?


#1

var friends = new Object();
friends.bill = new Object();
friends.steve = new Object();
friends.bill.firstname = "Bill";
friends.bill.lastname = "Gates";
friends.bill.number = "(206) 222 2222";
friends.bill.address = ["One Microsoft Way","Redmond","WA","98052"];

friends.steve.firstName= "Steve";
friends.steve.lastName= "Jobs";
friends.steve.number= "(848) 555-5555";
friends.steve.address = ["Apple Crossroads Drive", "Los Angles", "CA" , "98762"];

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

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


#2

Hi, you should put two }} .

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