Search for a friend why is my code working


#1

so im at search for a friend and I dotn know why my code works
my code:
var friends={
bill:{
firstName:'Bill',

    lastName:'Gates',

    number:423-553-4544,

    address:['Orange Microsoft Company','Around the corner','jolly good day']

    },
steve:{
    firstName:'Steve',

    lastName:'Jobs',

    number:532-544-5453,

    address:['Apple company','BlueWay','Can']

},


Jas:{

firstName:'Jaskaran',

lastname:'Singh',

number:533-433-4634,

address:['Behind my building','CanCurry']
},


Nate:{
    firstName:'Barthomolew',

    lastName:'Cocker',

    number:514-514-6380,

    address:['Idk where men ','Around kfc'] },


Luke:{
    firstName:'Luke',

    lastName:'Mannix',

    number:433-454-3522,

    address:['Right to my building','Aliwa']}

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


#2

@cwannabe,

+++ friends list and search and for-in explained.
Look here for an explanation
object
function
for-in-loop
list-function
search-function
http://www.codecademy.com/forum_questions/545275fd8c1ccc8e3e000a23#comment-5457b12c9c4e9d87cb00003f


#4