complete lesson
This commit is contained in:
@ -1,12 +1,16 @@
|
||||
import {Car} from './car'
|
||||
|
||||
// create a new car and store it in the variable 'a'
|
||||
const a = new Car();
|
||||
// set some data for that car
|
||||
a.manufacturer = 'Benz';
|
||||
a.model = 'Velo';
|
||||
|
||||
// do the same for a second car
|
||||
const b = new Car();
|
||||
b.manufacturer = 'Ford';
|
||||
b.model = 'Model T';
|
||||
|
||||
// use a function of the car class to print out the information
|
||||
a.print_info();
|
||||
b.print_info();
|
Reference in New Issue
Block a user