Hello,
I understand this exercise except for one thing. The ** part in the code below is why the solution isn’t accepted. Instead, it’s supposed to be in bracket notation:
return obj[checkProp];
Can we not use dot notation for this? I prefer it, but this is more of a conceptual question. Thanks!!!
function checkObj(obj, checkProp) {
if (obj.hasOwnProperty(checkProp)) {
**return obj.checkProp**;
} else {
return 'Not Found';
}
}
Challenge: Testing Objects for Properties
Link to the challenge: