class Car {
constructor(name, year) {
this.name = name;
this.year = year;
}
carDetails() {
console.log("Car name: " + this.name, "
Car year: "+ this.year);
}
drive() {
console.log("Driving!")
}
}
let car = new Car("Audi", 2019);
car.carDetails();
car.drive();