Ran solution through a console outside of FCC editor:
function checkObj(obj, checkProp) {
// Only change code below this line
if (obj.hasOwnProperty(checkProp)) {
return obj[checkProp];
} else {
return "Not found!";
}
}
checkObj({gift: “pony”, pet: “kitten”, bed: “sleigh”}, “house”)
“Not found!”
checkObj({city: “Seattle”}, “district”)
“Not found!”
checkObj({pet: “kitten”, bed: “sleigh”}, “gift”)
“Not found!”
This code passes the test.
Alternative same code when it’s ran through the FCC code editor, renders different results:
// running tests
checkObj({gift: “pony”, pet: “kitten”, bed: “sleigh”}, “house”) should return the string Not Found.
checkObj({city: “Seattle”}, “district”) should return the string Not Found .
checkObj({pet: “kitten”, bed: “sleigh”}, “gift”) should return the string Not Found
. // tests completed
Why different results? Bug? Please help… very stuck!