How do I solve this?!

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
if(obj.hasOwnProperty(checkProp)) {
  return obj.checkProp;
} else {
  return "Not Found";
return "Change Me!";
// 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/97.0.4692.99 Safari/537.36

Challenge: Testing Objects for Properties

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

You can only use dot notation with the exact literal name of the property.

I solved it. I had to use bracket notation on “obj.checkProp” instead of dot notation. Thank you anyway!

Oh, like I said here :wink:

1 Like

I managed to pass the test by writing it obj[checkPro], cause it wasn’t working with the dot notation.

Right. That’s exactly what you need to do since, as I said in my first post, you cannot use dot notation in this case.

1 Like

Oh, I see! Thanks again!

1 Like

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