Testing object for properties, please someone should help

I try all I can but couldn’t find the error in it.

function checkObj(obj, checkProp) {

  // Only change code below this line

  var myObj = {

     gift: "pony",

     pet: "kitten",

     bed: "sleigh"

  };

  function checkObj(checkProp) {

// Your Code Here

if (myObj.hasOwnPproperty(checkProp)) {

  return myObj[checkProp];

  } else {

    return "Not Found";

  }

}

  // Only change code above this line

}

  console.log(checkObj("pet"));

Please consider this answer you received before

We are not able to help without all the needed info

It looks like you’ve copied a solution from the past that doesn’t work anymore because this problem has been changed (among other errors). Try resetting your code and trying again from scratch, asking for help if there’s anything you don’t understand.

1 Like