This challenge is driving my crazy. Any help with it will be much appreciated.
This is what I got:
function lookUpProfile(name, prop){
var i=0;
while (i > contacts.length) {
if (contacts[i]["firstName"] === name) {
var j = 0;
while (j < contacts.length) {
if (contacts[j].hasOwnProperty(prop)) {
return contacts[j][prop];
}
j++;
return "No such property"
}
}
i++;
}
return "No such contact"
}
Thank you!