Tell us what’s happening:
Getting an ‘X’ still on the requirement: checkObj({pet: "kitten", bed: "sleigh"}, "gift") should return "Not Found" .
I’m not sure what I should do to meet this requirement? All others are fine.
Your code so far
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"}
function checkObj(obj, checkProp) {
// Only change code below this line
if (myObj.hasOwnProperty(checkProp)){
return myObj[checkProp];
}
return "Not Found";
}
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.
the object being tested is anyway the one passed in
if you use obj inside the function it will use function parameter, and as it has found something it will not look outside of the function for its value
(with myObj the function didn’t have a variable named such so it looked outside to find it)