Hi! This is my code:
function lookUpProfile(firstName, prop){
// Only change code below this line
for (var x = 0; x < contacts.length; x++) {
if (contacts[x].firstName == firstName) {
if (contacts[x].hasOwnProperty(prop)){
return contacts[x][prop];
}
else {
return "No such property";
}
} else {
return "No such contact";
}
}
// Only change code above this line
}
// Change these values to test your function
lookUpProfile(“Harry”, “likes”);
It’s not working with “Harry” - why? Explain me pls.