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

Learn JavaScript CLASSES in 6 minutes! 🏭
1 year ago
12
Automotive
Education
Programming
Coding
Software Development
Web Development
Mobile App Development
Computer Science
Coding Tutorial
Code Learning
Programming Language
// class = (ES6 feature) provides a more structured and cleaner way to
// work with objects compared to traditional constructor functions
// ex. static keyword, encapsulation, inheritance
class Product{
constructor(name, price){
this.name = name;
this.price = price;
}
displayProduct(){
console.log(`Product: ${this.name}`);
console.log(`Price: $${this.price.toFixed(2)}`);
}
calculateTotal(salesTax){
return this.price + (this.price * salesTax);
}
}
const salesTax = 0.05;
const product1 = new Product("Shirt", 19.99);
const product2 = new Product("Pants", 22.50);
const product3 = new Product("Underwear", 100.00);
product1.displayProduct();
const total = product1.calculateTotal(salesTax);
console.log(`Total price (with tax): $${total.toFixed(2)}`);
Loading comments...
-
50:21
Michael Franzese
2 hours agoThe Rise and Fall of Joe Colombo: From Head of the Family to Public Enemy
21.1K3 -
8:21
Talk Nerdy Sports - The Ultimate Sports Betting Podcast
1 hour ago4/4/25 - AI Madness & Friday Fire
10.7K -
DVR
Dr Disrespect
7 hours ago🔴LIVE - DR DISRESPECT - WARZONE - VERDANSK SOLOS
141K10 -
LIVE
FusedAegisTV
4 hours agoRumble Smackdown! #001 Street Fighter 6 $500 Online Tournament
125 watching -
LIVE
Major League Fishing
3 days agoLIVE! - MLF Bass Pro Tour: REDCREST - Day 2
175 watching -
1:08:28
Twins Pod
10 hours agoConservative Latina FIRECRACKER Running For CONGRESS! | Twins Pod - Episode 59 - Valentina Gomez
40.6K12 -
1:07:56
Jeff Ahern
3 hours ago $1.00 earnedFriday Freak out with Jeff Ahern (1pm Pacific)
30.7K -
2:11:58
The Quartering
6 hours agoTrump's Job Market EXPLODES, Bill Burr Runs, Matt Walsh Triggers , Leftist Attacks My Company
179K97 -
1:06:15
Sean Unpaved
6 hours agoColorado Set To Host NFL Showcase, Last Final Four Predictions, & Bracket Challenge Update!
59.4K2 -
1:23:40
Ben Shapiro
6 hours agoEp. 2173 - FALLOUT: Stock Market Drops, Trump Pushes On
90.4K99