7. Search for a friend. Wrong output



<Below this line, add a link to the EXACT exercise that you are stuck at.>

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>
Exercise is passed, but output is wrong.
{ firstName: ‘Steve’,
lastName: ‘Jobs’,
number: ‘(206) 666-6666’,
address: [ ‘One Apple Way’, ‘Palo Alto’, ‘CA’, ‘888888’ ] }
{ firstName: ‘Steve’,
lastName: ‘Jobs’,
number: ‘(206) 666-6666’,
address: [ ‘One Apple Way’, ‘Palo Alto’, ‘CA’, ‘888888’ ] }
{ firstName: ‘Bill’,
lastName: ‘Gates’,
number: ‘(206) 555-5555’,
address: [ ‘One Microsoft Way’, ‘Redmond’, ‘WA’, ‘98052’ ] }

var friends = {
    bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: "(206) 555-5555",
        address: ['One Microsoft Way','Redmond','WA','98052']
    steve: {
        firstName: "Steve",
        lastName: "Jobs",
        number: "(206) 666-6666",
        address: ['One Apple Way','Palo Alto','CA','888888']
var list = function (friends) {
    for (var firstName in friends) {

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



the exercise validates the code, to see the true output you could run your code here


Looks like this thing is very useful, but I don’t understand how to use it)
So my code in JS-window, I push ‘run with JS’ in output-window, and it shows nothing.


its is indeed, if you just simply want to run some code :slight_smile:

make so to have the console-window open, the output-window is a html page. console.log() logs to console, not html page

That is because there is no steve in among your friends, only a Steve


Result is the same.
There no difference if I search for steve or Steve, output is two times Steve and one time Bill.


even on jsbin? Maybe in the exercise because of exercise validition, not on Jsbin, it should output only steves info


sill have problem on jsbin.
it shows nothing in console-window.

but code looks ok?


When i search for "Steve" i get result on console window, can you link me the bin you use? Easier to share a bin then the code


Something new for me)
I just need to send you link like this?


normally that would work, but the forum has problem with the jsbin links since a while. Anyway, like i said, there is not steve:


you have to search for Steve:


then there is output


Get it.
Thanks for your time!