Thoran Thoran - 11 months ago 35
Javascript Question

Could "super" be used inside a method of subclass to call the corresponding method of super-class without direct referencing?

I came across a usage of "super" in a tutorial that seemed strange.

is used inside the method
of the subclass to call the method
of the superclass without using any accessor notations. Would that work? If yes, where can I find more references about it?


No, direct super calls (without a property) are only allowed in constructors, and constitute syntax errors everywhere else. It needs to be super.get().