Tell us what’s happening:
hey guys,
the code doesn’t return my “Not Found”. instead, it shows undefined
Your code so far
function checkObj(obj, checkProp) {
// Only change code below this line
if (obj.hasOwnProperty) {
return obj[checkProp];
}
else {
return answer;
}
// Only change code above this line
}
console.log(checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "Amir"))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36
.
Challenge: Testing Objects for Properties
Link to the challenge: