Mascara Try it Download Buy About Documentation Blog

'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