Accessing object properties with dot and bracket notation

To access the object property assigned to ‘checkProp’ in this exercise, only the bracket notation seems to work in the return line.
return myObj[checkProp];

The dot notation is not working,
return myObj.checkProp;

Can someone explain why?

See the following reply I gave yesterday to someone with the same question. In the future, try using the forum search to see if your question has been asked in the past. 99% of the time someone has asked a similar question.

Thank you! This was helpful