Print only one name!


as the image shows, it always print the same ("bill") name only not print out the "Steve"


@microslayer50641, I saw 2 errors:

1st. Put name as a parameter to function search:

var search = function(name) { ... }

2nd. Wrong property name (#25):

if(friends[prob].firstName == name)


@denys.matsevych, you missed the semi-colon at the end of line 25, which prevents the if clause from working properly, but for the rest your answer really catches all the mistakes :slight_smile:

@microslayer50641, the exercise calls some of your function for validitation purposes, so if you want to see what the real output looks like, run it outside the codecademy enviroment


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.