You can define getter and setter functions in JS, which from the outside just look like normal objects properties, but since they’re functions can do additional work when accessed.
Could for example be useful to log access to properties when you’re not sure if they’re still used somewhere.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get
 

Kind of reminds me of Ruby’s Virtual Attributes.

Example getter and setter