class Car {
constructor(make, model) {
this.make = make;
this.model = model;
}
toString() {
return `${this.make} ${this.model}`;
}
}
const car1 = new Car("Hyundae", "G70");
const car2 = new Car("KIA", "ray");
console.log(car1.toString()); // Hyundae G70
console.log(car2.toString()); // KIA ray