What is wrong with this code? It says "Oops, try again. It looks like your search function doesn't return contact information for Steve."


var friends = {
bill: {
firstName: "Bill",
lastName: "Thorton",
number: "(765) 869-7654",
address: ['42 East Redwood St', 'Charming','CA','99017']
steve: {
firstName: "Steve",
lastName: "Johnson",
number: "(765) 246-8435",
address: ['64 Clarence St','Charming','CA','99017']
var list = function(paramete){
    for(var temp in paramete){

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


Read carefully what your function should compare the argument to, does it really say the first name?


Check your capitalisation. - I did exactly the same!


Capitalization of what, the firstName fields? That would cause it to pass, yes, BUT it would be two wrongs making a "right". You're not supposed to be looking at the first name at all, something else is asked for.


Yes we are; "If the argument passed to the function matches any of the first names in friends,"


Ah. Right you are!
The previous one for the list function lists keys, this one matches the firstName field.


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