"first name not deffined"


#1

Hello, can anyone see what is wrong with my code i keep getting the error "first name is not defined"

var friends = {

bill: {
    firstName: "bill",
    lastName: "Gates",
    number: "1234",
    address: ['1 microsoft way', 'ohio', 'usa']
},
Steve: {
    firstName: "Steve",
    lastName: "jobs",
    number: "10190",
    address: ['1 apple way', 'new york', 'usa']
}

};

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

var search = function(name){
for(var key in friends){
if(name === friends[key].firstname ){
console.log(friends[key]);
return friends[key];
}
}
};
list(friends);
search("Steve");


#2

Hi,
Things here are case-sensitive. Make sure you have that correct :slightly_smiling:
good luck!


#3

Beat me to it. That's it, check that the variable names match exactly.


#4

thankhyou i new it would be something really obvious :stuck_out_tongue: