Tell us what’s happening:
var Obj = {
gift: "pony",
pet: "kitten",
bed: "sleigh",
};
myObj.hasOwnProperty(checkProp); {
return myObj[checkProp];
}
return “Not Found”;
// Only change code above this line
}
Your code so far
function checkObj(obj, checkProp) {
// Only change code below this line
function checkObj(checkProp){
return myObj.hasOwnProperty(checkProp)===true?myObj[checkProp]: "Not Found";
}
// Only change code above this line
}
i dont know how else i am supposed to write this code, i need help
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36.
Challenge: Testing Objects for Properties
Link to the challenge: