Basic JavaScript - Testing Objects for Properties

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

I can’t figure out why the following isn’t working.

   **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
}
   **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Testing Objects for Properties

Link to the challenge:

That may be the problem with the extensions, such as dark mode or ad-blockers… (so your code is good)

Try to disable them, then reload the page

Yeah, your code passes for me. I would say to reboot, try a different browser, reset the browser cache… If not, just back out of that challenge and move onto the next.

Thanks guys, I tried it in a different browser and it worked for me. I’ll try that next time first!

1 Like