Using “dot” notation doesn’t work to recall the property, but using bracket notation works just fine. This appears to be a bug. Dot notation was working just fine prior to this example.
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
if ( myObj.hasOwnProperty(checkProp) ) {
return myObj.checkProp;
}
return "Not Found";
}
// Test your code by modifying these values
checkObj("bed");
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0
.
Link to the challenge:
https://www.freecodecamp.org/challenges/testing-objects-for-properties