Premium Only Content
The JavaScript SUPER keyword is super! 🦸♂️
00:00:00 intro
00:00:22 setup
00:02:39 super constructor
00:05:59 super methods
00:09:03 conclusion
// super = keyword is used in classes to call the constructor or
// access the properties and methods of a parent (superclass)
// this = this object
// super = the parent
class Animal{
constructor(name, age){
this.name = name;
this.age = age;
}
move(speed){
console.log(`The ${this.name} moves at a speed of ${speed}mph`);
}
}
class Rabbit extends Animal{
constructor(name, age, runSpeed){
super(name, age);
this.runSpeed = runSpeed;
}
run(){
console.log(`This ${this.name} can run`);
super.move(this.runSpeed);
}
}
class Fish extends Animal{
constructor(name, age, swimSpeed){
super(name, age);
this.swimSpeed = swimSpeed;
}
swim(){
console.log(`This ${this.name} can swim`);
super.move(this.swimSpeed);
}
}
class Hawk extends Animal{
constructor(name, age, flySpeed){
super(name, age);
this.flySpeed = flySpeed;
}
fly(){
console.log(`This ${this.name} can fly`);
super.move(this.flySpeed);
}
}
const rabbit = new Rabbit("rabbit", 1, 25);
const fish = new Fish("fish", 2, 12);
const hawk = new Hawk("hawk", 3, 50);
rabbit.run();
fish.swim();
hawk.fly();
-
1:10:26
Sean Unpaved
3 hours agoJalen Hurts & Eagles COLLAPSE In LOSS vs. Cowboys | UNPAVED
16.5K2 -
2:00:25
Steven Crowder
5 hours agoNo Influencer Safe: New X Update Exposed A Major Psyop
422K254 -
17:38
Professor Nez
3 hours agoTHIS will HAUNT Jasmine Crockett for Years...
14.9K20 -
56:36
The Rubin Report
4 hours agoTense Moment at Trump-Mamdani Meeting That No One Predicted
46.7K62 -
9:34
The White House
4 hours agoFirst Lady Melania Trump Welcomes the Official 2025 White House Christmas Tree
35.2K16 -
LIVE
LFA TV
17 hours agoLIVE & BREAKING NEWS! | MONDAY 11/24/25
1,944 watching -
1:01:32
VINCE
6 hours agoNew Info Blows the Lid Off The Butler Assassination Attempt | Episode 175 - 11/24/25 VINCE
267K241 -
1:46:29
The Mel K Show
3 hours agoMORNINGS WITH MEL K - A Time to Choose: The People Must Reclaim Power 11-24-25
32.2K12 -
1:23:10
The Shannon Joy Show
3 hours agoMarjorie Taylor Greene DUMPS Trump, Defects To ‘America First’ Setting Up NEW Paradigm For 2028 Presidential Election
21.6K15 -
53:41
Grant Stinchfield
20 hours ago $2.92 earnedABC SETUP: Michael McCaul Falls for Martha Raddatz Trap on Live TV!
21.2K2