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
Welcome to the Rebellion Podcast
12 hours agoDon3po is Live - WTTR Podcast Live 9/4
202 watching -
13:43
The Kevin Trudeau Show Limitless
23 hours agoClassified File 3 | Kevin Trudeau EXPOSES Secret Society Brainwave Training
44.5K9 -
LIVE
The Chris Salcedo Show
13 hours agoAmericans Are Tired Of Leftists & Fake-GOP Who Cater To Them
541 watching -
1:12:23
Game On!
20 hours ago $0.94 earnedFootball IS BACK! Cowboys vs Eagles Opening Night Kickoff!
7.32K1 -
LIVE
The Bubba Army
23 hours ago#1 Documentary IN THE WORLD! - Bubba the Love Sponge® Show | 9/04/25
1,649 watching -
39:31
Her Patriot Voice
14 hours ago $1.84 earnedBlack Conservative Surrounded + ROBBED By Leftists!
11.2K25 -
13:25
The Gun Collective
14 hours agoWOW! A LOT of new GUNS just dropped!
12.7K8 -
2:02:53
BEK TV
1 day agoTrent Loos in the Morning - 9/04/2025
9.47K -
8:13
Geoff_Tac
1 day agoMAC 1014 Shotgun (Benelli Clone)
7.79K2 -
22:30
Ohio State Football and Recruiting at Buckeye Huddle
14 hours agoOhio State Football: How Matt Patricia Confused Arch Manning and Texas
15.1K