This code is not working... Need Help, pls

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
let obj = {
  "gift": "pony",
  "pet": "kitten",
  "bed": "sleigh"
 };

 obj.hasOwnProperty(checkProp);
return obj[checkProp] || "Not Found";
// 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/98.0.4758.102 Safari/537.36

Challenge: Testing Objects for Properties

Link to the challenge:

Hi @TheSoberOne33 !

Welcome to the forum!

This is common mistake but you are not supposed to create this object

You can delete that.

Reason being is because you want to create a function that works for 100’s of objects and 100’s of function calls.
Right now your function would only work for the object you wrote yourself.

Hope that helps!

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