Basic JavaScript - Testing Objects for Properties

*Hello. Not sure why my code isn’t passing. Please help. Thank you.

Your code so far

function checkObj(obj, checkProp) {
  // Only change code below this line
  if (checkObj.hasOwnProperty(checkProp)) {
    return checkObj[checkProp];
  } else {
    return "Not Found"
  }

  // Only change code above this line
}

Challenge: Basic JavaScript - Testing Objects for Properties

Link to the challenge:

What is ‘checkObj’? Hint: it’s not an object

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