javaSript coding challenge

I’m having trouble getting my code to pass the Profile lookup coding challenge. Here is what I have.

  for (var i = 0; i < contacts.length; i++) {
    if(contacts[i].firstName === name) {
      return contacts[i][prop] || "No such property";
    }
  }
  return "No such contact";
}

Did you check the hints? Click in “Get a hint” button to see some explanations and proposed solutions.

what do the tests say? what do you think could be going wrong? what’s the challenge link? what’s your code returning for the failed tests? what should it return?

I am also moving this to the #javascript subforum, as it is more in topic there

omg never mind it was something stupid smh

It was my syntax I feel so stupid lol.

3 Likes

@ieahleen That’s a great list and I love how it starts at zero. :smiley:

That’s exactly right lmao!!!