Objects for properties cannot pass the test

I am not passing all the tests

var obj = {
 gift: "pony",
 pet: "kitten",
 bed: "sleigh",
 city: "Seattle"

function checkObj(checkProp) {
var answer = ""
  answer = obj[checkProp]
}  else {
  answer =  "Not Found"

return answer;


Link to the challenge:

1 Like


It looks like you’ve changed the parameters of the function declaration provided by the challenge. I would suggest resetting the lesson to write the code as suggested by the challenge, or you can add obj back in as a parameter, and your code should pass as is.

Hope this helps!


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.