Tell us what’s happening:
Hi campers! I don’t know what’s wrong with my code.I have tried to solve this problem by consulting several different posts but it still does not work.I am stuck here from several hours.Please guide me
**Your code so far**
function checkObj(obj, checkProp) {
// Only change code below this line
var myList = {
"gift":"pony",
"pet": "kitten",
"bed": "sleigh",
"city": "Seattle"
};
if (myList.hasOwnProperty(checkProp)) {
return myList[checkProp];
} else {
return("Not Found");
};
};
// Only change code above this line
console.log(checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "gift"));
console.log(checkObj({pet: "kitten", bed: "sleigh"}, "gift"));
console.log(checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "pet"));
console.log(checkObj({city: "Seattle"}, "city"));
console.log(checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "house"));
console.log(checkObj({city: "Seattle"}, "district"))
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
.
Challenge: Testing Objects for Properties
Link to the challenge: