#6 in contact list


#1

var friends = new Object();
friends.bill={
    firstName : '',
    lastName : '',
    number :'',
    address:[]
};
friends.steve={
    firstName : '',
    lastName : '',
    number :'',
    address:[]
};
friends.sneha={
    firstName : '',
    lastName : '',
    number :'',
    address:[]
};
friends.aparna={
    firstName : '',
    lastName : '',
    number :'',
    address:[]
}
friends.prakkam={
    firstName : '',
    lastName : '',
    number :'',
    address:[]
};
var list = function(friends)
{
    for(var friends in object)
    {
console.log(list);
    }
}

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

this is what i have written.. and this is what it is showing..could someone explain me about this.. im not even exactly sure about what it is asking and what i have wrote..and mistake in my code


#2

You need to put the object name where it says object and the parameter in your function needs to be different. This is what I have:

var friends={
bill: {
firstName:'Bill',
lastName:'C',
number: 555-28-345,
address: ['wemdon drive', 'dallas', 'texas', '75220']
},
steve: {
firstName:'Steve',
lastName:'D',
number: 555-28-1111,
address: ['slalom consulting way', 'seattle', "wa", "98101"]
}
};

var list = function(parameter)
{
for(firstName in friends)
{
console.log(firstName);
}

};


#3

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