Search for a friend


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

var friends= new Object();
friends.bill=new Object();
friends.steve=new Object();
        firstName: "Bill",
        number:"(206) 555-5555",
        address: ['One Microsoft Way','Redmond','WA','98052']

friends.steve = {
  firstName: "Steve",
  lastName: "Jobs",
  number: "(408) 555-5555",
  address: ['1 Infinite Loop','Cupertino','CA','95014']
var list=function(arg){
  for (var key in arg){
    console.log(arg[key])} };
var search=function(name){
    for( var key in friends){
      if (name===friends[key].firstName){
// list(friends);     


You made Bill and Steve two objects apiece. Also, it may not be absolutely necessary, but please semicolons.


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