Searching for a friend: code debug help


#1


I need help debugging this:

var friends = {
    bill: {
    firstName:"Bill" ,
    lastName:"Gates" ,
    number:"(206) 555-5555",
    address: ['One Microsoft Way','Redmond','WA','98052']
    } ,
    steve: {
    firstName:"Steve" ,
    lastName:"Bertin" ,
    number:"(206) 777-7777",
    address: ['Two Intel Road','Salt Lake','UT','84056']
    }
};
var friends =function (list) {
    for (var key in object){
    console.log(key);}
};


#2

i think it might be the comma right here. I'm not totally sure though. try deleting it and see if it works


#3

if that doesn't work can you send me a link?


#4

Yeah. I definitely will.


#5

The problem is it says I didn't create a function called list.


#6

yes,because there is no function in your code named list

your function name is friends now.it should be list.

and here

for (var key in object){

write the name of the variable where you store an object in the place of object


#8

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