Tell us what’s happening:
Describe your issue in detail here.
is still get this: checkObj({pet: “kitten”, bed: “sleigh”}, “gift”) should return the string Not Found.
How do i fix my code
.
**Your code so far**
function checkObj(obj, checkProp) {
// Only change code below this line
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle",
};
if(myObj.hasOwnProperty(checkProp)){
return myObj[checkProp];
}
else return "Not Found";{
}
return "Change Me!";
// Only change code above this line
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36.
You are creating your own object, myObj. Don’t do that - you should be using the one that is passed in as a parameter, obj. That way the function is more flexible and the tests can test it with different objects.