Where is the mistake in this?


#1

https://www.codecademy.com/courses/javascript-beginner-en-3bmfN/0/7?curriculum_id=506324b3a7dffd00020bf661#

it kept asking me to create a search function which i already did

var friends = {};
friends.bill = {
    firstName: 'lamba',
    lastname: 'jeje',
    number: 8089507424,
    address: ['27 ifelodun street ogba']
};
friends.steve = {
    firstName: 'boss',
    lastName: 'oga',
    number: 8057784640,
    address: ['26 odetola avenue kola alagbado']
    };
    var list = function(zach){
        for (var abey in zach ){
            console.log(abey);
            }
            };
var search = function(name){
    for(var abey in freinds){
        if (friends[abey].firstname === name ){
            console.log(friends[abey]);
            return friends[abey];
            }
        }
    };


#2

Could you please paste your code?


#3

just did that now please recheck


#4

Need to review the spelling.


#5

i corrected it just now, but still saying the same thing


#6

Not sure why you used the word Zach here. Should be friends. For both.


#7

i changed both now what am getting is.................... Oops, try again. It looks like your search function doesn't return contact information for Steve. any help please?


#8

I think the contact info for the friends needs to be word for word from what's given to you.
Copy mine:

bill: {
        firstName: "Bill",
        lastName: "Gates",
        number: 0210242154,
        address: ['microsoft@live.com', '123', 'microsoft way'] 
        },
    

    steve: {
        firstName: "Steve",
        lastName: "Jobs",
        number: 0215484325,
        address: ['apple@apple.com'],
    }

#9

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