It keeps telling me i didnt pint out right!


#1
friends = new Object();
friends.bill = new Object();
friends.steve = new Object();
var friends = {
    steve:{
        firstName:"steve",
        lastName:"ho",
        number:"110",
        address:["shanxi","xian","baihexian"]
        },

    bill: {
        firstName: "bill",
        lastName: "tan",
        number:"22234422",
        address: ["福建省","厦门市","思明区","湖滨南路"]
    }

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

}
list("steve");

here is my code ... i dont get it ....


#2

A little more complicated than needs be...

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

The above function takes an object and outputs the primary keys of that object.


#3

oh thank you .... it works .