Profile look up error in my code.Help out please

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/profile-lookup

better add link to you problem or ask help clicking Ask for help
i did’t get your problem to help you

I added the link to my question

if (contacts[x].firstName === name)
hey man look in your code you
edit inside the if statement

inside if condition you compare

(contacts[i].firstName===firstName)

here you are firstName is not define earlier so you are getting error in your code

firstName is not defined

You don’t have a firstName variable anywhere… check what the function parameters are

1 Like

thanks it should be name instead