Hello,
Profile Lookup
When I test each case manually, my code works. But it doesn’t pass the test.
function lookUpProfile(name, prop) {
// Only change code below this line
for (var profil in contacts) {
if (contacts[profil].firstName === name) {
if (contacts[profil].hasOwnProperty(prop)) {
console.log(contacts[profil][prop])
return profil[prop]
} else {
console.log('No such property')
return 'No such property';
}
}
}
console.log('No such contact')
return 'No such contact';
// Only change code above this line
}