Testing Objects for Properties 200

Hi!
So the test works, but my code does not pass the challenge.
Can anyone see why?

Your code so far

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
 if (myObj.hasOwnProperty(checkProp)) {
   return myObj[checkProp];
   
 } else {
   return "Not found";
 }
}

// Test your code by modifying these values
checkObj("house");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/testing-objects-for-properties

AHHHHHHHHHHHHHHH found it!
“Not Found”, I wrote, “Not found”…
I have aged trying to figure this one out…

2 Likes

Hey, this was really helpful! Thank you!