Can not check for object properties in Basic JS

function checkObj(obj, checkProp) {
  // Only change code below this line

  if(obj.hasOwnProperty(checkProp) == true){
    return obj[checkProp]
  }else{
  return "Not found";
  }
  // Only change code above this line
}


console.log(checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "gift"));
console.log(checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "house"));

Even though my code is right,Freecodecamp does not except my solution.I will be deeply appreciated if anyone give me a hit/suggestion.
I also attached my screenshot of my work.

the test:

should return "Not Found"

you:

do you see the difference?


next time, If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like

Hey,Thanks a lot for your kind help.