Python classes have this neat feature where you can decorate a class method with the @property decorator, which makes the method appear as a statically-valued member rather than a callable. For example, this:
class A(object):
def my_method(self):
return "I am a return value."
@property
def my_property(self):
return "I am also a return value."
results in the following behavior:
>>> a = A()
>>> a.my_method()
'I am a return value.'
>>> a.my_property
'I am also a return value.'
So finally, my question: is there any built-in syntax that provides similar behavior in ES6 classes? I'm not an expert on the documentation (yet) but so far I don't see anything that provides this type of functionality.