Tell us what’s happening:
What did I do wrong?
Your code so far
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Only change code below this line
if (myObj.hasOwnProperty(checkProp)) {
return myObj.hasOwnProperty[checkProp];
} else
{return "Not Found"}
// Only change code above this line
}
checkObj("gift");
Your browser information:
User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1
.
Challenge: Testing Objects for Properties
Link to the challenge: