I am unable to render this code. I presume it’s because gift has been defined as “pony”, so trying to make it render for “Not Found” too is a bit tricky. Please help.
function checkObj(obj, checkProp) {
// Only change code below this line
var checkObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle",
};
if(checkProp == "gift") {
return "pony";
} else if(checkProp == "pet") {
return "kitten";
} else if(checkProp == "house") {
return "Not Found";
} else if(checkProp == "city") {
return "Seattle";
} else if(checkProp == "district") {
return "Not Found";
} else if (checkProp == "gift") {
return "Not Found"
}
// Only change code above this line
}
Challenge: Testing Objects for Properties
Link to the challenge: