What is wrong with below code please help


#1

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

friends.bill.firstName = "Bill";
friends.bill.lastName = "Gates";
friends.bill.number = "(206) 555-5555";
friends.bill.address= ['One Microsoft Way','Los Angelos','NY','65052'];

friends.steve.firstName = "Steve";
friends.steve.lastName = "Jobs";
friends.steve.number = "(206) 555-5555";
friends.steve.address= ['One Microsoft Way','Redmond','WA','98052'];

var list = function(friends){
for(var firstName in freinds){
console.log(firstName+": "+friends[firstName]);
}
}


#2

Hi try to just print firstName like that

console.log(firstName)


#3

hi thanks for the suggestion yes i tried but im getting the below error

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

I'm going on getting this error


#4

Hi try this

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

#5

same error throws again
please do verify the below link

https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/6?curriculum_id=506324b3a7dffd00020bf661#


#6

Try that

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

#7

wow superb at last it works thank you very much