Б
Size: a a a
Б
Б
EB
EB
JN
JN
Ð
TV
Ð
TV
Б
Б
Ð
АП
AV
const program = () => {В другом чате мне подсказали написать
const response = askQuestion(player, dealer);
if (response == 1) {
console.log(response);
process.exit(0);
}
};
const askQuestion = (player, dealer) => {
// rl.question(`One more card? 1 - YES, otherwise - NO.`, (response) => { return +response });
const response = '1';
return +response;
};
response.then(number => if (number == 1) console.log(number)
rl.question(`One more card? 1 - YES, otherwise - NO.`, response.then(number => if (number == 1) console.log(number));при этом пишет Cannot read property 'then' of undefined и завершает работу. Не понял, где нужно поставить слово Promise и вообще правильный ли тут ход мыслей. Напишите прям в коде, пожалуйста, я уже не первый день бьюсь с этой проблемой.
倫岡
const program = () => {В другом чате мне подсказали написать
const response = askQuestion(player, dealer);
if (response == 1) {
console.log(response);
process.exit(0);
}
};
const askQuestion = (player, dealer) => {
// rl.question(`One more card? 1 - YES, otherwise - NO.`, (response) => { return +response });
const response = '1';
return +response;
};
response.then(number => if (number == 1) console.log(number)
rl.question(`One more card? 1 - YES, otherwise - NO.`, response.then(number => if (number == 1) console.log(number));при этом пишет Cannot read property 'then' of undefined и завершает работу. Не понял, где нужно поставить слово Promise и вообще правильный ли тут ход мыслей. Напишите прям в коде, пожалуйста, я уже не первый день бьюсь с этой проблемой.
И