Need help!


I don't understand the last part of this lesson. I made a function called list, but the for loop in it makes no sense. The error message says: "Oops, try again. Did you create a function called list?"

var friends = new Object();
friends.bill = {
    firstName: "Bill",
    lastName: "Gates",
    number: "512-545-8002",
    address: ["2109","Reston Cove","Round Rock, TX"]
friends.steve = {
    firstName: "Steve",
    lastName: "Jobs",
    number: "512-999-5124",
    address: ["1492","magical pathway","HELL!"]
var list = function (friends)   {
    for (var key in object) {


HI your for loop ..

for (var key in object) {

you want to loop through friends so it should be

for (var key in friends)

then you should print key instead of friends inside the for loop


Will you kindly check on my same situation?


Hi You should post your code or create a new topic with tour code And The error You get


A loop only iterates over enumerable properties. Objects created from built–in constructors like Array and Object have inherited non–enumerable properties from Object.prototype and String.prototype, such as String's indexOf() method or Object's toString() method. The loop will iterate over all enumerable properties of the object itself and those the object inherits from its constructor's prototype (properties closer to the object in the prototype chain override prototypes' properties).
Not (var key in object).
Its for(var key in friends)