Tell us what’s happening:
Describe your issue in detail here.
Hehehehe…Oh Please can some wonderful person help and stop me from pulling all my hair out in frustration. I’ve been battling with this exercise for a few hours. All the checks pass except for the last one:
checkObj({pet: "kitten", bed: "sleigh"}, "gift")
should return the string Not Found
.
Can someone please tell me what am I doing wrong?
Many thanks, Pierson
**Your code so far**
function checkObj(obj, checkProp) {
// Only change code below this line
var obj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
if(obj.hasOwnProperty(checkProp)) {
return obj[checkProp];
} else {
return "Not Found";
}
// Only change code above this line
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
Challenge: Testing Objects for Properties
Link to the challenge: