List 'em all!


#1


Hello guys, can someone help figure out what's wrong with my code.
I get an unexpected error each time, and I've also been to the forum but still can't figure it out


var friends = {
    //we've added two empty ojects to our friends object
    bill: {
       firstName: "Bill",
       lastName: "Gates",
       number: "(206) 555-5555",
       address: ['One Microsoft Way', 'Redmond', 'WA', '98052']
       },  
    steve: {
       firstName: "Steve",
       lastName: "Jobs",
       number: "(205) 777-7777",
       address: ['Three Apple Drive', 'Ottumwa', 'CA', '89330']
        },
        
var list = function (friends){
      for(var key in friends){
         console.log(key);  
    }
 }
 
};

list(friends);


#2

your list should be after your friends object, currently you nested your function inside you friends object


#3

Thanks for the reply:
And why d I have them names printed twic??
bill
steve
bill
steve


#4

the exercise calls your function for validation purpose, the side effect is that you get more output then expected (goes for the whole contact list track)

if you want to see your code in action, go to jsbin, open javascript and console tab, and press run js code in top right corner


#5

Alright, Thanks again


#6