Добавил бесконечный цикл и проверку на число

related #3
parent acf6d8ab
import { Driver } from "./Driver";
import { Truck } from "./Truck";
import readlineSync from 'readline-sync';
const john = new Driver("John", "Doe", 35, 10);
const jack = new Driver("Jack", "Rose", 55, 30);
......@@ -11,10 +12,14 @@ const daf = new Truck(3, "DAF XF", jane);
const trucks: Truck[] = [renault, volvo, daf];
function getTrucksIngo (truks: Truck[]): void {
function getTrucksInfo (truks: Truck[]): void {
console.log('№ | Грузовик | Водитель | Состояние');
for (let i = 0; i < trucks.length; i++) {
trucks[i].getInfoAll();
};
};
getTrucksIngo(trucks);
\ No newline at end of file
while (true) {
const userAns: any = readlineSync.question('Меню:\n 1. Отобразить текущее состояние грузовиков\n 2. Показать данные грузовика по id \nВыберите действие: ');
let isNum: boolean = isNaN(userAns);
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment