[Testing Objects for Properties] -

[Testing Objects for Properties] -
0

#1

The code I have is this:

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  if (myObj.hasOwnProperty(checkProp) === true);
  return myObj[checkProp];
  else {
    return "Not Found";
  }
}

// Test your code by modifying these values
checkObj("gift");

This is pretty much exactly like code found in other forum posts where it’s touted as the code that’s working. However, when I click “Run” tests, I get no feedback at all. Nothing below 'Your test output will go here. ', no error anywhere, nothing.


#2

Try removing the semicolon at the end of the if-condition


#3

Of course! I forgot to check console and see the syntax error. Oh silly me.