My code doesn't work

Tell us what’s happening:

Your code so far


function checkObj(obj, checkProp) {
// Only change code below this line
var myObj = {
gift: “pony”,
pet: “kitten”,
bed: “sleigh”
};

function checkObj(checkProp) {
// Your Code Here
if(myObj.hasOwnProperty(checkProp)){
return myObj[checkProp];
}
else if(myObj.hasOwnProperty(checkProp) !== true){
return “Not Found”;
}
else{
return “Change Me!”;
}
}


return "Change Me!";
// Only change code above this line
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15.

Challenge: Testing Objects for Properties

Link to the challenge:

You should not be adding the variable myObj and declaring the function inside of the function. You need to remove myObj and the extra declaration.