What is the solution for this i cant understand TT


#1

var friends = {
friends = {
bill: {
firstName:"Bill",
lastName:"Gates",
number:"09756684136",
address:['Alabang','Muntinlupa','City']
},
steve: {
firstName:"Steve",
lastName:"Jobs",
number:"09757173165",
address:['GMA','Cavite']
},
var list = function (friends)
{
for (var key in friends)
{
console.log(key);
}
}

}


Replace this line with your code.


#2

Your steve object is closed, but the friends object is not. You won't need a comma after the last object in friends. Remember to remove the stray closing brace from the end.


#3

can I have the correct codes? I'm very confused about that topic TT


#4

We need to be sure your functions are not written inside the friends object.

var friends = {

};

var list = function () {

};

In your original code, move the stray closing curly brace from the bottom to just above your function, after the steve object. The friends object should resemble this pattern...

var friends = {
    bill: {

    },
    steve: {

    }
};

#5

thanks so much it helps me a lot


#6

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