No idea what i did wrong someone please explain

Tell us what’s happening:
Describe your issue in detail here.

no idea what i did wrong

  **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
}

Challenge: Testing Objects for Properties

Link to the challenge:

Two things:

  • You should return “Not Found” if the property is not found (case matters)
  • obj(checkProp) this is a function call. You don’t want to use parens to access the property of an object.

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