I am trying to do the exercice using the property hasOwnProperty .
i did this code bellow but i only getting Not Found as a result.
obj.hasOwnProperty(“checkProp”) returns always false
**Your code so far**
function checkObj(obj, checkProp)
{
if (obj.hasOwnProperty("checkProp"))
{
return obj[checkProp];
}
else
{
return "Not Found";
}
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Safari/537.36 Edg/101.0.1210.32
Challenge: Testing Objects for Properties
Link to the challenge: