Tell us what’s happening:
Describe your issue in detail here.
Hi, I have problem passing the run.
If gift is "pony"then why does it say:
checkObj({pet: "kitten", bed: "sleigh"}, "gift")
should return the string Not Found
.?
since gift: “pony”, is included in the objects.
any help would be appreciated.
Thanks
Your code so far
function checkObj(obj, checkProp) {
// Only change code below this line
var checkObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
if (checkObj.hasOwnProperty(checkProp)) {
return checkObj[checkProp];
} else {
return "Not Found";
}
return "Change Me!";
// 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: