JavaScript Super Keyword Last Updated : 19 Jun, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The super keyword is used to call the parent class's constructor to access its properties and methods. Syntax:super(arguments);super.parentMethod(arguments);Arguments: This keyword can accepts all the arguments that has been used to create a constructor. Example: The code defines Person and FashionDesigner classes, where FashionDesigner extends Person. The person has methods for work, home, and sleep states. FashionDesigner adds a profession method and a combined task method. An instance of FashionDesigner is created, and its methods' outputs are displayed using a display function. JavaScript class Person { constructor(name, age) { this.name = name; this.age = age; } atWork() { return this.name + " is at work, "; } atHome() { return this.name + " is at home"; } sleeping() { return this.name + " is sleeping"; } } class FashionDesigner extends Person { constructor(name, age) { super(name, age); } profession() { return this.name + " is a Fashion Designer"; } doTasks() { return super.atWork() + this.profession(); } } function display(content) { console.log(content); } const character = new FashionDesigner("Sayan", 30); display(character.profession()); display(character.atHome()); display(character.doTasks()); OutputSayan is a Fashion Designer Sayan is at home Sayan is at work, Sayan is a Fashion Designer Comment More infoAdvertise with us Next Article How To Fix SyntaxError â Cannot use 'super' without 'extends' in JavaScript? M MugdhaBehere Follow Improve Article Tags : JavaScript Web Technologies javascript-basics Similar Reads Calling A Super Class Constructor in Scala Prerequisite - Scala ConstructorsIn Scala, Constructors are used to initialize an object's state and are executed at the time of object creation. There is a single primary constructor and all the other constructors must ultimately chain into it. When we define a subclass in Scala, we control the sup 3 min read Calling A Super Class Constructor in Scala Prerequisite - Scala ConstructorsIn Scala, Constructors are used to initialize an object's state and are executed at the time of object creation. There is a single primary constructor and all the other constructors must ultimately chain into it. When we define a subclass in Scala, we control the sup 3 min read Java JComponent In Java Swing, JComponent is an abstract class that programmers can use to modify to build unique components that are suited to the particular requirements of their applications. JComponent and other Swing components are lighter than their AWT equivalents. The Java runtime renders lightweight compon 6 min read How to fix ReferenceError â Super constructor may only be called once in JavaScript? In JavaScript "ReferenceError: Super constructor may only be called once" error occurs when you call super more than once in a derived class constructor, the super keyword calls the parent class constructor and must be called only once, we can see this error, reasons behind it as well as how to corr 3 min read How To Fix SyntaxError â Cannot use 'super' without 'extends' in JavaScript? A âSyntaxError: Cannot use âsuperâ without âextendsââ exception in JavaScript crops up when super is called through a class method but the class does not come from an extended class, the super keyword is supported as a means of invoking the parent class constructor or methods, and it must be used on 2 min read Difference between Primary key and Super key Key concepts that play a significant role in DBMS are the Primary Key and the Super Key. While both are fundamental to the structure and functionality of a database, they serve distinct purposes and have different characteristics. A Primary Key is a specific, minimal set of attributes that uniquely 4 min read Like