Here’s my solution to test called “Basic JavaScript: Testing Objects for Properties” and I don’t really understand what’s wrong with it since everything looks good. It says :
checkObj(“house”)should return"Not Found" while it Does return “Not found”…
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty(checkProp) == true) {
return myObj[checkProp];
}
else {
return "Not found";
}
}
// Test your code by modifying these values
console.log(checkObj("house")); //Returns "Not found"....