7.search a friend


var friends = new Object();
friends.bill = new Object();
friends.steve = new Object();
friends.bill.firstName = "Bill";
friends.bill.lastName = "Gates";
friends.steve.firstName = "Steve";
friends.steve.lastName = "Job";
friends.bill.number = 982;
friends.steve.number = 894;
friends.bill.address = [34,"gulmohar","thane"];
friends.steve.address = [45,"vasant vihar","thane"];

var list = function(friends){
for(var firstName in friends){

var search = function(name){
for(var firstName in friends){
if(friends.firstName === name){
return friends;
return false;

Oops, try again. It looks like your search function doesn't return contact information for Steve.

where I am wrong and reason behind it after reading many post i think the code is proper
please help

Replace this line with your code.



can anyone help me iam stcuk with this


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.