Contact List


could anyone help me with it

why we used:- return friends[key];



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

So that,

var key = 'bill';
// {}

bill and steve are keys or member names of the friends object. I like to call these primary keys since they are on the top level.

In a loop construct made with a statement it is common to see key used as the iterator variable of the loop. Each iteration points to a different key, using this variable to hold the name.


might at one time be,


and at another,



@mtf thanks i got it..

but why return??
when we have already used console to display..friends[key]