Tell us what’s happening:
Describe your issue in detail here.
Hello… I’ve run the code multiple times now and still failing to get a clear solution. I’ve followed the hints from the forum and still end up like this.
My error outputs:
checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "house")
should return the string Not Found
.
checkObj({city: "Seattle"}, "district")
should return the string Not Found
.
checkObj({pet: "kitten", bed: "sleigh"}, "gift")
should return the string Not Found
.
**Your code so far**
function checkObj(obj, checkProp) {
// Only change code below this line
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 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0
Challenge: Testing Objects for Properties
Link to the challenge: