No such content exist output

function lookUpProfile(name, prop) {

for(var i = 0; i < contacts.Length; i++){
if(name == contacts[i].firstName && true === contacts[i].hasOwnProperty(prop)){
  return contacts[i].prop;
if(name == contacts[i].firstName && false === contacts[i].hasOwnProperty(prop)) {
  return "No such property";
  return "No such content exist";

So I’m working on the profile lookup javascript problem. For some reason when I try testing my outputs I keep receiving my final case variable. “No such content exist”. I’ve been stuck on this problem for a week and could use another hint or recommendation. Thank you.

This is a typo.

I think it should say ‘contact’ and shouldn’t have ‘exist’.

It would help if you could provide a link to the challenge.

Click the profile lookup link but here is also a link below.

If name does not correspond to any contacts then return the string No such contact.

Yep, wrong message.

And the issue with Length I mentioned above.

1 Like

Thank you sir!!

My mind is stuck in C#. Getting a lot closer to the answer.

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