Let's say I have a simple object a = {b: 2}
. I know of two ways to get the value of property b of a:
Dot notation: a.b // 2
and
Bracket Notation: a['b'] // 2
Practicality aside, does there exist any way to get the value of b from object a without using either of these two methods (dot notation and bracket notation)? MDN's page on Property Accessors only lists the 2 methods.
It's just a curiosity I had. I know there exist obscure ways to call functions without parenthesis, eg
parseInt`5.1`
I wanted to see if a similarly obscure thing was possible for Property access.