What's wrong with my code.please explain?


var friends = {
firstName: "Bill",
lastName: "Johson",
number: "09157757865",
address: ['One Microsoft Way','Redmond','WA','98052']
Steve: {
firstName: "Steve",
lastName: "Rock",
number: "09157735461",
address: ['Bonaficio','taguig','manila','98602']
var list = function (friends){
for(var j in friends){
var search= function(name){
for(var firstName in friends){
return friends[firstName];


Not sure what exact lesson you are on...
edit: removing code.


thanks but it still showing an error as "It looks like your search function doesn't return contact information for Steve.". This lesson is search for a friend.


var friends needs closing at the top ={}
Should be friends.bill = {
Look closely above steve. You can see a comma also you should use friend.(name here)
friends.steve = {
As well as Bill, you need steve to be the same as bill
Get rid of the first { underneath the address for steve as it is un-needed.
As well as missing a function for an object
var list = function (obj) {
Should be for(var prop in friends){
as well as under it changing to
if(friends[prop].firstName === name)
You then need to move console log later so after the statement before put a
the console log etc.

after console log put a
As well as your search being bill when it should be steve.
You should have a list for friend like list(friends)

return friends

should be
return friends friends[prop];
console.log (friends[prop]);

You miss most of the logical things like these = most of the time anything else that needs fixing should be decently logical,