Testing objects for properties (error coming up)

Tell us what’s happening:
what is wrong with my code as this specific error keeps coming up
checkObj({pet: "kitten", bed: "sleigh"}, "gift") should return "Not Found" .

Your code so far

function checkObj(obj, checkProp) {
 // Only change code below this line
 var Obj ={
     gift: "pony",
     pet: "kitten",
     bed: "sleigh",
     city: "Seattle"
if (Obj.hasOwnProperty(checkProp))
{return Obj[checkProp];
else {
 return "Not Found";
 // Only change code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.108 Safari/537.36.

Challenge: Testing Objects for Properties

Link to the challenge:


This text will be hidden

this function is being passed in the object {pet: "kitten", bed: "sleigh"} which doesn’t have the “gift” property

you are always testing the Obj object you have created instead of the function parameters

Thanks for the hint. Just solved it