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:45:51
Game On!
22 hours ago $10.16 earnedWise Guys Reveal NFL Week 2 BEST BETS Now
56.4K7 -
26:57
Robbi On The Record
2 days agoMouth Breathing Is Why You’re Exhausted | with Dr. Melanie Silvestrini
20.3K5 -
LIVE
Total Horse Channel
6 hours ago2025 Reno Snaffle Bit Futurity | Sunday Finals
141 watching -
40:44
SouthernbelleReacts
7 days ago $2.84 earned“Event Horizon (1997) Reaction | Hellraiser in Space with Sam Neill & Laurence Fishburne”
29.6K4 -
10:49
Artur Stone Garage
3 days ago $2.02 earnedI Spent $2000 on My Turbo Honda Civic Build (Before & After)
29.8K9 -
0:44
Danny Rayes
18 hours ago $3.25 earnedDid Someone Know It Was Going To Happen?
31.5K10 -
15:03
World2Briggs
1 day ago $2.91 earnedShocking Home Prices in Florida's Cheapest Towns!
28.1K6 -
58:02
ChopstickTravel
4 days ago $1.10 earnedBillionaire Food in Dubai 🇦🇪 Super Luxury MICHELIN +WAGYU + CAVIAR in UAE!
20.1K1 -
21:20
Advanced Level Diagnostics
12 days ago $1.13 earned2020 Toyota Sienna - Crank No Start! Never Seen This Before!
22.9K2 -
49:04
The Why Files
6 days agoMajestic 12 | Secret Documents Expose UFO Cover-Up Vol. 1
58.8K72