Why does list function return lowercase?



var friends = new Object();
friends.bill = {
firstName: "Bill",
lastName: "Miller",
number: "246-468-8642",
address: ['4 Silver Lane', 'Austin', 'TX', '02468']};

friends.steve = {
firstName: "Steve",
lastName: "Knudsen",
number: "135-357-9753",
address: ['3 Bronze Circle', 'Tucson', 'AZ', '01357']};

var list = function(){
for (var firstName in friends){

var search = function(name){
for(var i in friends){
if(friends[i].firstName === "Bill"){
return friends[i];}}};


When I call the list function, the names Bill and Steve print in all lowercase in the console. Why is that?

Replace this line with your code.


Consider the make up of the object, friends...

var friends = {
    bill: {},
    steve: {}

The keys are not the firstName properties found in each object. They are ordinary variable names.

for (var key in friends) {
// bill
// steve