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";
}
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