6/8 Help!


#1

I'm getting an error message that I don't understand. Here is my code so far:

var friends = {
bill: {
firstName: "Bill",
lastName: "Gates",
number: "(631) 123-4567",
address:["One Microsoft Lane", "New York", "NY","11706"]
},
steve: {
firstName: "Steve",
lastName: "Jobs",
number: "(516) 765-4321",
address:["Two Bullshit Street", "New York", "NY","11705"]
},
};
var list = function(freinds){
for(var fristName in friends){
console.log(firstName)
};
};
console.log(list);

I'm getting the error message "Did you create a function called list?"

I thought I did that on line 15 with "var list=function(friends){
I'm an a bit confused on what I am doing wrong, I hope it is something simple that I'm missing.

Thanks
-Matt


#2

Hey @lischakm! The problem is when you call your list. Your not suppose to log it. Instead of your code here:

Do this so you can call the function

list(steve);

#3

Hi , you just misspelled "friends" when declaring your function , you wrote "freinds".


#4

Thank you for your help!!!


#5

I'm still getting the same error message even when I call try to call the function. I put console.log(firstName) inside the function and outside of it I call it using list(bill); and list(steve);

what am i missing? Am I not creating the function correctly?


#6

Can you print-screen your results.


#7

You have var fristName instead of firstName...


#8

Here is a screen shot of what happens when I hit Save and submit


#9

Take a look at line 15. You are calling a key "friends" in your object "friends" when there is no key by that name in your object.