What is super() function in JavaScript?

JavascriptWeb DevelopmentFront End Technology

Use the super() function to call the constructor of the parent class and access functions on an object's parent class.


You can try to run the following code to implement super()

Live Demo

<!DOCTYPE html>
         class Department {
            constructor() {}
            static msg() {
               return 'Hello';
         class Employee extends Department {
            constructor() {}
            static displayMsg() {
               return super.msg() + ' World!';
Published on 30-Jan-2018 11:32:51