Expressions and patterns

super keyword

Try the free JavaScript compiler

In a derived constructor super invokes base construction and initializes the receiver; in a method, super property access starts lookup at the prototype of its home object while preserving this.

Formal Syntax & Structure

javascript syntaxjavascript
super(...args); super.method(...args)

Working Example

Example Snippetjavascript
class B{m(){return this.n;}}class C extends B{n=4;m(){return super.m()+1;}}console.log(new C().m());
JavaScript Reference