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?
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?
Thank you! This was helpful