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
22
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...
-
LIVE
BonginoReport
57 minutes ago“Womanosphere” Podcasts Trigger Leftist Media - Nightly Scroll w/ Hayley Caronia (Ep.34) - 04/24/25
3,268 watching -
LIVE
Dad Dojo Podcast
5 hours agoEP29: Lebron Turns Heel, Steroids and more
474 watching -
LIVE
Kim Iversen
2 hours agoXi and Zelensky IGNORE Trump: Is America's Power Crumbling?
12,130 watching -
1:25:56
vivafrei
4 hours agoJudge Cano BANNED from the Bench! Is That the COVER-UP? Tariffs, Trans in Military & Fall of Canada!
52.7K24 -
47:49
Candace Show Podcast
1 hour agoShannon Sharpe Out At ESPN. I Taylor Swift Subpoena Incoming. | Candace Ep 182
16.8K29 -
LIVE
Ark of Grace Ministries
7 hours agoProphecy Fulfilling The Pope Has Passed Over & A Great Shaking In The Earth
3,105 watching -
LIVE
Spartan (Pro Halo esports Player)
2 hours agoSdcrims no comms, then College match
119 watching -
36:41
Kimberly Guilfoyle
2 hours agoBorder Security is National Security, Interview with Tyler O'Neil | Ep216
38.2K8 -
1:12:19
Dr. Drew
1 day agoLIVE From Washington DC w/ Harmeet Dhillon & DOJ Attorney Michael Gates – Ask Dr. Drew
25.5K6 -
LIVE
LFA TV
20 hours agoALL DAY LIVE STREAM - 4/24/25
687 watching