Tell us what’s happening:
I just completed this challenge by returning obj[checkprop], but I wanted to check what happened if I returned obj.checkprop, which did not work. Why does it not work using dot notation is this scenario?
Thanks for any feedback!
Your code so far
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
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36.