Hi
I’ve been at this for a couple hours and the tests pass for the properties that exist
However, I get an error when I try to pass a property that doesn’t exist instead of the false path which should return Not Found?
Can anyone spot the error?
Thanks
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
// Your Code Here
var prop = myObj.hasOwnProperty(checkProp);
if (prop = true){
return myObj[checkProp];
}else{
return "Not Found";
}
}
// Test your code by modifying these values
checkObj("gift");