class cars {
constructor(id, name, color) {
this.id = id;
this.name = 'AUDI';
this.color = 'red';
}
color() {
this.color += 100;
}
}
export {cars};
// another js file
import {cars} from './another-file.js';
const car = new cars(1, 'AUDI', 'red');
console.log(car.id);
console.log(car.name);
car.color();
console.log(car.color);