Gives an error when submitting 'list' function


#1


List 'em all!

Oops, try again. Did you create a function called list?


Replace this line with your code. 

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

friends.bill.firstName = "Bill";
friends.bill.lastName = "Ivanov";
friends.bill.number = "(555) 555-5555";
friends.bill.address = ["Tymoshenka","Marshala",13];

friends.steve.firstName = "Steve";
friends.steve.lastName = "Obama";
friends.steve.number = "(777) 777-7777";
friends.steve.address = ["Petra","Pancha",17];

var list = function (friends) {
    for (var key in object) {
        console.log(key);
        }
    }


#2

here:

for (var key in object)

object is the general term we use to describe objects (like bill, steve or friends), which of this objects do you want to loop over?


#3

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