// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
if(myObj.hasOwnProperty(checkProp) === true){
return myObj.checkProp;
}
return "Not Found!";
}
// Test your code by modifying these values
console.log(checkObj("gift"));
You have a lot of unnecessary code, if you use hasOwnProperty() it will be much shorter and much more reusable - what if the object get new properties?