16 lines
392 B
TypeScript
16 lines
392 B
TypeScript
|
/**
|
||
|
* the class is defined with the export keyword to make it usable outside of the current file
|
||
|
*/
|
||
|
export class Car {
|
||
|
// define the fields
|
||
|
manufacturer: string = '';
|
||
|
model: string = '';
|
||
|
|
||
|
// define the function print_info
|
||
|
print_info() {
|
||
|
console.log('Car Information:');
|
||
|
console.log(`- manufacturer: ${this.manufacturer}`);
|
||
|
console.log(`- model: ${this.model}`);
|
||
|
}
|
||
|
}
|