Hey guys, got a problem with the Testing Objects for properties lesson. I'm trying to find a way to return all the values of the object myObj
but I can't seem to find the answer online. Any ideas?
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
if (myObj.hasOwnProperty("gift" || "pet" || "bed")) {
return myObj; //Object value?
}
else {
return "Not Found";
}
}
// Test your code by modifying these values
checkObj("gift");