Tell us what’s happening:
Got stuck on something. I am getting the following error messages when running the tests. Anyone see where the issue(s) is/are? thank you
// running tests
checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "gift")
should return
"pony"
checkObj({gift: "pony", pet: "kitten", bed: "sleigh"}, "pet")
should return
"kitten"
checkObj({city: "Seattle"}, "city")
should return
"Seattle"
. // tests completed // console output
This is what I have so far:
//Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
city: "Seattle"
};
function checkObj(checkProp) {
// Only change code below this line
if (myObj.hasOwnProperty(checkProp)) {
return myObj[checkProp];
} else {
return "Not Found"
}
// Only change code above this line
}
console.log(checkObj("city"));
**Your browser information:**
User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0</code>.
**Challenge:** Testing Objects for Properties
**Link to the challenge:**
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/testing-objects-for-properties