Premium Only Content
JavaScript CONSTRUCTORS in 5 minutes! ðŸ›
#JavaScript #tutorial #course
// constructor = special method for defining the
// properties and methods of objects
function Car(make, model, year, color){
this.make = make,
this.model = model,
this.year = year,
this.color = color,
this.drive = function(){console.log(`You drive the ${this.model}`)}
}
const car1 = new Car("Ford", "Mustang", 2024, "red");
const car2 = new Car("Chevrolet", "Camaro", 2025, "blue");
const car3 = new Car("Dodge", "Charger", 2026, "silver");
car1.drive();
car2.drive();
car3.drive();
console.log(car1.make);
console.log(car1.model);
console.log(car1.year);
console.log(car1.color);
console.log(car2.make);
console.log(car2.model);
console.log(car2.year);
console.log(car2.color);
console.log(car3.make);
console.log(car3.model);
console.log(car3.year);
console.log(car3.color);
-
4:56:56
a12cat34dog
8 hours agoTHIS WAS A HIDDEN GEM :: Watch Dogs :: HACKIN' EVERYTHING & SHOOTING SH*T {18+}
19.1K3 -
2:46:02
Laura Loomer
8 hours agoEP164: TPUSA's Identity Crisis: The Big Tent & Islam Dilemma
50.4K40 -
3:23:23
VapinGamers
8 hours ago $1.00 earnedOff the Grid - It's Been A Hot Min. Playin with Rando's - !rumbot !music
15.3K2 -
3:03:34
PixelRealms
7 hours ago $3.62 earnedPlaying Enshrouded for the Final night of the Christmas Cheer-A-Thon!
21.6K1 -
55:56
Dad Saves America
11 hours ago $3.88 earnedMarxist Judges. Woke Coaches. High School Debate—Hijacked: The Death of Debate - Pt 5
33.7K6 -
2:35:21
CassaiyanGaming
6 hours ago🟣LIVE - CASSAIYAN - The Grinch: Christmas Adventures Game
9.29K -
2:24:52
We Like Shooting
20 hours ago $3.05 earnedWe Like Shooting 642 (Gun Podcast)
27.8K2 -
58:08
Flyover Conservatives
1 day agoHow Pete Evans Went from Mainstream Fame to Medical Censorship—and Why RFK Jr. Took Notice | FOC Show
31.6K -
1:14:12
Donald Trump Jr.
12 hours agoOur American Revival: Why This Movement Matters More Than Ever | Triggered Ep.302
275K199 -
32:05
Stephen Gardner
12 hours agoYou WON’T Believe The GOOD NEWS Trump Just Got!!
51.3K64