Help I’m stuck with this problem
Modify the function checkObj to test if an object passed to the function (obj) contains a specific property (checkProp). If the property is found, return that property’s value. If not, return “Not Found”.
function checkObj(obj, checkProp) {
// Only change code below this line
if(obj.hasOwnProperty("checkpro")){
return obj["checkpro"];
}
else {
return "Not Found";
}
// Only change code above this line
}
Link to the challenge: