Mascara: Next Generation JavaScript compiler

Try it Download Buy About Documentation Blog Contact

'super' keyword

The super keyword is used:

- in constructors to call the superclass-constructor

- inside methods to access methods on the superclass.

Example of using super in a method:

class A {
   function foo(){ return 7; }
}
 
class B extends A {
   function foo(){ return super.foo(); }
}
var b = new B;
b.foo();  //--> returns 7
X Try!
Mascara JavaScript Generated JavaScript

Translating...
Show compiler settings