Hello FreeCodeCamper s
I’m trying to find a property inside my object with the hasOwnProperty()
method, but when I pass the argument to the function, although I have declared
the object
earlier to the function but its return Not Found
var obj = {
age : "29",
};
function checkObj(obj, checkProp) {
// Only change code below this line
if (obj.hasOwnProperty(checkProp)){
return obj[checkProp];
}
return "Not Found";
// Only change code above this line
}
console.log(checkObj( "age"))
im sure that i have a mistake somewhere any Hint will be appreciated