Testing Objects for Properties. Help

Testing Objects for Properties. Help
0

#1

I can’t figure out why my code is not passing could someone help me out and let me know were I am going wrong.

// 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”);


#2

Try using straight quotation marks " or ’ instead of curly quotations.