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);
-
LIVE
SpartakusLIVE
5 hours agoThe Return of the KING of Content
533 watching -
10:05
MattMorseTV
8 hours ago $0.64 earnedHe actually did it...
34.5K17 -
1:32:39
Anthony Rogers
1 day agoEpisode 376 - Todd Schowalter
12.5K -
3:42:07
megimu32
4 hours agoOTS: Movie Tie-In Games + Remakes: Let’s Play Memory Lane
17.8K6 -
1:15:06
Adam Does Movies
11 hours ago $0.02 earnedTalking Movies + Ask Me Anything - LIVE
22K -
1:17:18
Glenn Greenwald
1 day agoWhat are CBS News' Billionaire Heirs Doing with Bari Weiss? With Ryan Grim on the Funding Behind It; Europe Capitulates to Trump Again | SYSTEM UPDATE #494
102K81 -
1:43:49
RiftTV
6 hours agoCNN Calls Black NY Shooter WHITE, Cincinnati FATIGUE | The Rift | Guest: Braeden Sorbo, 2Protects1
49.6K14 -
4:21:04
LumpyPotatoX2
7 hours agoKilling Floor 3: Rampage & Chaos - #RumbleGaming
14.5K -
6:56:22
BrancoFXDC
7 hours ago $0.56 earnedPlaying Ranked Warzone - Pursuit of Diamond Rank
14.7K -
1:11:41
Omar Elattar
7 hours agoThe Brain Experts: "Your Overthinking Problem Has A Physical Solution & We Can Show You!"
17.4K3