Tell us what’s happening:
Describe your issue in detail here.
I really don’t understand what im doing, i don’t know how to do the Not Found response, thinking i was following the past lessons i believe what i was doing is correct, but checking forums there are things i have to do outside of what this lesson teaches you? I honestly don’t know where i am standing either Your code so far
function checkObj(obj, checkProp) {
// Only change code below this line
const checkObj = {
gift: "pony",
pet: "kitten",
bed: "sleight",
city: "Seattle",
};
return checkObj[checkProp];
// 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/109.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Testing Objects for Properties
function checkObj(obj, checkProp) {
// Only change code below this line
var obj = {
gift: "pony",
pet: "kitten",
bed: "sleight",
city: "Seattle"
};
if (obj.hasOwnProperty(checkProp)) {
return obj[checkProp];
} else {
return "Not Found";
}
// Only change code above this line
}
Now, the only test im missing is the last one:
“checkObj({pet: "kitten", bed: "sleigh"}, "gift") should return the string Not Found” which returns: " checkObj({pet: “kitten”, bed: “sleigh”}, “gift”) should return the string Not Found."
Passed it, but i completely don’t understand how i passed the tests if i didn’t declare what it asked (example: gift: “pony” and such), i am at a complete loss