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();
-
LIVE
BEK TV
23 hours agoTrent Loos in the Morning - 11/25/2025
182 watching -
LIVE
The Bubba Army
22 hours agoMAJORIE TAYLOR GREENE QUITS! - Bubba the Love Sponge® Show | 11/25/25
1,567 watching -
51:11
ZeeeMedia
15 hours agoBREAKTHROUGH: Nattokinase Dissolves 84% of Amyloid Microclots Within 2 Hours | Daily Pulse Ep 150
31K23 -
1:12:22
Coin Stories with Natalie Brunell
22 hours agoArnaud Bertrand on Changing World Order: U.S. vs China, Gold, Bitcoin & Dollar Hegemony
19.5K7 -
40:23
MetatronHistory
1 day agoI REFUSE To Use BCE/CE And Here is Why
8.07K8 -
16:00
Actual Justice Warrior
2 days agoDearborn Muslims Go To WAR With Protesters
11.6K33 -
16:33
Code Blue Cam
4 days agoWhen Begging for No Ticket Backfires Immediately
17K17 -
19:22
stateofdaniel
4 days agoPresident Trump STRIKES Back Against Democrats Who Encouraged Military to DEFY Him
18.4K9 -
14:12
itsSeanDaniel
1 day agoThe Dumbest Liberal in Congress Just EMBARRASSED Herself
17.7K11 -
1:57:56
MG Show
20 hours agoTrump and Mamdani's Surprisingly Cordial Meeting; Trump Posts Q Memes
26.7K16