7. Is this the right output?


#1

So I have a feeling that this is not the right output, but it passed me. Just want to make

THIS IS MY CODE

var friends = new Object();

friends.bill = new Object();
friends.steve = new Object();

friends.bill.firstName = "Bill";
friends.bill.lastName = "Gates";
friends.bill.number= "(206) 555-5555";
friends.bill.address = ["234 Windows Way", "Someplace, CA", "99999"];

friends.steve.firstName = "Steve";
friends.steve.lastName = "Jobs";
friends.steve.number = "(206) 555-5555";
friends.steve.address = ["234  iStreet", "Someplace, CA", "97899"];

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

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

THIS IS THE OUTPUT

{ firstName: 'Steve',
lastName: 'Jobs',
number: '(206) 555-5555',
address: [ '234 iStreet', 'Someplace, CA', '97899' ] }
{ firstName: 'Steve',
lastName: 'Jobs',
number: '(206) 555-5555',
address: [ '234 iStreet', 'Someplace, CA', '97899' ] }
{ firstName: 'Bill',
lastName: 'Gates',
number: '(206) 555-5555',
address: [ '234 Windows Way', 'Someplace, CA', '99999' ] }
["234 iStreet","Someplace, CA","97899"]


#2

@omgdracula,
You should add following code lines

list(friends);
search("Steve");
console.log( "== My End ==" );
console.log( "== All that is displayed now, is the course-checker ==" );

In some sections of this course, the course-checker Display's data
this you could then identify by placing to EXTRA code-line's:
console.log( "== My End ==" );
console.log( "== All that is displayed now, is the course-checker ==" );


#3

Awesome! Will note for future answers! Much appreciated!