Premium Only Content
This video is only available to Rumble Premium subscribers. Subscribe to
enjoy exclusive content and ad-free viewing.

Learn JavaScript INHERITANCE in 7 minutes! 🐇
1 year ago
32
Automotive
Education
Programming
Coding
Software Development
Web Development
Mobile App Development
Computer Science
Coding Tutorial
Code Learning
Programming Language
// inheritance = allows a new class to inherit properties and methods
// from an existing class. Helps with code reusability
class Animal{
alive = true;
eat(){
console.log(`This ${this.name} is eating`);
}
sleep(){
console.log(`This ${this.name} is sleeping`);
}
}
class Rabbit extends Animal{
name = "rabbit";
run(){
console.log(`This ${this.name} is running`);
}
}
class Fish extends Animal{
name = "fish";
swim(){
console.log(`This ${this.name} is swimming`);
}
}
class Hawk extends Animal{
name = "hawk";
fly(){
console.log(`This ${this.name} is flying`);
}
}
const rabbit = new Rabbit();
const fish = new Fish();
const hawk = new Hawk();
console.log(rabbit.alive);
rabbit.eat();
rabbit.sleep();
rabbit.run();
Loading comments...
-
15:24
ArynneWexler
17 hours ago"I'm the Mayor Now" Somalian Midwest Takeover | NN Clip
1547 -
14:49
Esports Awards
17 hours agoEsports Awards 2025 Finalist Reveal
13 -
LIVE
BEK TV
22 hours agoTrent Loos in the Morning - 10/17/2025
213 watching -
53:31
Daniel Davis Deep Dive
15 hours agoU.S. War Dept v. Russia /Larry Johnson & Lt Col Daniel Davis
1562 -
3:40
NAG Daily
13 hours agoHOW TO NEVER BE WRONG AGAIN (A COMPLETE GUIDE W/GreenMan Reports)
48 -
9:21
Dr Disrespect
19 hours agoMOST INSANE 110 ASSIST Game in Battlefield 6
103K7 -
2:56:34
Side Scrollers Podcast
20 hours agoTwitch PROMOTES DIAPER FURRY + Asmongold/Trans CONTROVERSY + RIP Itagaki + More | Side Scrollers
44.1K8 -
23:30
GritsGG
16 hours agoThis Burst AR Still SLAMS! BR Casual Solos!
18.6K1 -
1:27:43
DeProgramShow
3 months agoEXCLUSIVE on DeProgram: “A Live Interview with Jake Tapper”
11.1K3 -
1:25:15
The HotSeat
15 hours agoHere's to an Eventful Weekend.....Frog Costumes and Retards.
20K8