My code went way wrong somewhere lesson 7 Search for a friend


#1


    contact1:"wearefew",
    contact2:"wearemany"
}

var friends = new Object();
friends.bill = new Object();
friends.steve = new Object();

var friends = {
    bill: {
        firstName:"Bill",
        lastName:"Franco",
        number:"(314) 777-6666",
        address:['Locomota Drive','Mo']
    }
};
var friends = { 
    steve: {
        firstName:"Steve",
        lastName:"Lardy",
        number:"(314) 666-7777",
        address:['Shazam Class Parkway','STL','55533']
   }
};
var friends = {
    wearemany: {
       firstName:"Wearefew",
       lastName:"Lasthorrah",
       number:"(314)999-9999", 
       address:['Tomb ToochieTown Drive','Ak']
   }
};
   var friends ={
    wearefew: {
       firstName:"Wearemany",
       lastName:"Shame",
       number:"(314)888-8888",
       address:['Kung Lao Hat Road','Ribbons']
   } 
};
   var list = function(friends){
       for(var firstName in friends){
           console.log(firstName);
   }
};
var search = function(friends){
       for(var firstName in friends){
           if(friends=== firstName){
               console.log(firstName);
               return friends(firstName);
           }
       }
   };












Replace this line with your code. 



#2

how do I post my entire code?


#3

I think you'll figure that out if you look at which parts got included and which did not and looking at what is different in the source of your post.

Similarly, finding the cause of your problem will involve comparing what your program does differently from what you want, so that is essential information that you've got to include ("wrong" does not carry this information)


#4

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