Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
function checkObj(obj, checkProp) {
// Only change code below this line
const myObj = {
gift:"pony",
pet:"kitten",
bed:"sleigh",
city:"Seattle"
};
if (myObj.hasOwnProperty(checkProp)){
return myObj[checkProp];
} else {
return "Not Found";
}
// Only change code above this line
}
So challenge is that if you type gift you get pony, but also if you type in gift you should get not found.
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.62 Safari/537.36
You’re hard coding one specific object (the example) into the function, meaning that if an object with different properties is given to the function (as in the tests) your function will return the wrong answer.
@josip.gajski7 I have a somewhat unrelated question. How did you get to that code, did you do a search for it on the forum?
Edit: I only ask because we are trying to make sure people do not find old solutions to challenges that may have been changed. And it seems to have somewhat worked with this challenge, so I’m just curious how you found the code.