Testing objects for properties fail

Tell us what’s happening:
Describe your issue in detail here.
Hello… I’ve run the code multiple times now and still failing to get a clear solution. I’ve followed the hints from the forum and still end up like this.

My error outputs:

checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "house") should return the string Not Found .

checkObj({city: "Seattle"}, "district") should return the string Not Found .

checkObj({pet: "kitten", bed: "sleigh"}, "gift") should return the string Not Found .

  **Your code so far**

function checkObj(obj, checkProp) {
// Only change code below this line
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; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0

Challenge: Testing Objects for Properties

Link to the challenge:

your code instead says

there is a small difference, but it’s different enough that it causes test failure, fix that and it will pass

man, thank you. it takes a person to see what i’m doing wrong.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.