JSFiddle - React, Tailwind, and code Playground
Babel + JSX
class Car {
constructor(model, year, drive) {
this.model = model;
this.year = year;
this.drive = drive;
}
info (name) {
return name+ ' ' +this.model+ ' ' +this.year+ ' ' +this.drive;
}
}
let car = new Car('Volvo', 2006, 'AWD')
console.log(car);
alert(car.model);
alert(car.info('Anton'));