6.list them all


#1

https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/6?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 friend in friends){
console.log(friends);
}
}

i get this message

Oops, try again. It looks like your list function isn't printing the right output.


#2

@leonhard.wettengmx.n your "about objects" talk is needed. thanks


#3

Hi.you should print steve and bill.therefore you should change the key to firstName.
for(var firstName in friends)
console.log(firstName);


#4

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