7.search a friend


#1

https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/7?curriculum_id=506324b3a7dffd00020bf661#
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){
console.log(firstName);
}
}

var search = function(name){
for(var firstName in friends){
if(friends.firstName === name){
console.log(friends.firstName);
return friends;
}
else{
return false;
}
}
}
search("Steve");

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.

`


#2

can anyone help me iam stcuk with this


#3

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