Tell us what’s happening:
Describe your issue in detail here.
my code is not working as it does not comply with the last required taskbar element, namely: checkObj({pet: "kitten", bed: "sleigh"}, "gift")
should return the string Not Found
.
I don’t understand how to declare this result as ‘Not Found’ when these properties are necessary to solve former taskbar elements. This is the last requirement before the code runs smoothly.
I have not found any other info as a past thread on this challenge seems irrelevant as it does not mention the myObj properties while the Hint does not provide an adequate solution.
**Your code so far**
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle",
};
function checkObj(obj, checkProp) {
// Only change code below this line
if(myObj.hasOwnProperty(checkProp)){
return myObj[checkProp];
}
else {
return "Not Found"
}
// Test your code by modifying these values
checkObj("gift");
// Only change code above this line
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Challenge: Testing Objects for Properties
Link to the challenge: