Very stuck "search for a friend"


I continue to get the error did you create a function called search. heres my code;

var friends = {};
friends.bill = {
firstName: "Bill",
lastName: "Adkins",
number: "(302) 765-5631",
address: ['the end drive']
friends.steve = {
firstName: "Steve",
lastName: "Coker",
number: "(635) 255-5555",
address: ['the beginning drive']
var list = function(friends) {
for(var firstName in friends){
var search = function(name){
for(var firstName in friends){
if(friends[firstName].firstName === name){


Do you understand what you wrote here means? I am asking about the syntax?


I thought I was asking to return "Steve"


Syntax for return:

var x = "Hello, world";
return x; //Returns 'Hello, world'

var y = 123;
return y; //Returns '123'

return "Hello, world"; //These are the same as
return 123; //the ones above, without using variables.


okay that's great. You know what you have to output so add a closing brace after the last line here

and remove the closing brace before this line

Run it and see the output of your return


Wow! that was it! Thanks rydan