Tell us what’s happening:
I’ve put checkProp within double quotes when checking with hasOwnProperty as that’s what they demonstrated in the example code given in FreeCodeCamp. Do they have an instructor to help people out with doubts?
Your code so far
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty("checkProp")){
return myObj["checkProp"];}
else{
return "Not Found";
}
}
// Test your code by modifying these values
checkObj("gift");
Your browser information: