It seems to me like this:
class Car {
constructor(brand) {
this.brand = brand;
this.intro = function() {
console.log("Hi! I am a " + this.brand + "!");
}
}
}
const car1 = new Car("BMW")
and this:
function car(brand) {
this.brand = brand;
this.intro = function() {
console.log("Hi! I am a " + this.brand + "!");
}
}
const car2 = new car("Mercedes")
are doing the exact same.
I feel like it didn't get the crucial point about classes here. Thank you very much!