super - JavaScript | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

Super-calling static methods

You are also able to call super on static methods.

Deleting super properties will throw an error

You cannot use the delete operator and super.prop or super[expr] to delete a parent class' property — it will throw a ReferenceError.

Deleting super properties will throw an error

You cannot use the delete operator and super.prop or super[expr] to delete a parent class' property — it will throw a ReferenceError.

object initializer

Super can also be used in the object initializer notation. In this example, two objects define a method. In the second object, super calls the first object's method. This works with the help of Object.setPrototypeOf() wi

Object.setPrototypeOf()

Super can also be used in the object initializer notation. In this example, two objects define a method. In the second object, super calls the first object's method. This works with the help of Object.setPrototypeOf() wi

static private elements

When calling super.prop as a function, the this value inside the prop function is the current this, not the object that super points to. For example, the super.getName() call logs "Extended", despite the code looking lik

Setting super.prop sets the property on this instead

Setting properties of super, such as super.x = 1, behaves like Reflect.set(Object.getPrototypeOf(objectLiteral), "x", 1, this). This is one of the cases where understanding super as simply "reference of the prototype obj

Learn how to contribute

This page was last modified on Jul 8, 2025 by MDN contributors.

Expressions and operators

Numbers and strings

Representing dates & times

Regular expressions

Indexed collections

JavaScript typed arrays

Iterators and generators

Resource management