1//using es6 classes
2class Vehicle {
3 constructor(name, maker, engine) {
4 this.name = name;
5 this.maker = maker;
6 this.engine = engine;
7 }
8}
9
10let car1 = new Vehicle('GT', 'BMW', '1998cc');
11
12console.log(car1.name); // GT
13