Created
August 19, 2018 14:11
-
-
Save Khuzha/a47a9a7da265cd4eef6f7b45c11f02e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const prompt = require('prompt-sync')(); | |
let names = []; | |
for (let i = 0; true; i++) { | |
if (i == 0) { | |
let answer = prompt('Введите первое имя. Для завершения ввода оставьте строку пустой и просто нажмите Enter: ', 'Спасибо. Ввод имен завершен.'); | |
if (answer = '') { | |
console.log('Вы не ввели ни одного имени'); | |
break; | |
} else { | |
names[i] = answer; | |
} | |
} else { | |
let answer = prompt('Вводите имена: ', 'Спасибо. Ввод имен завершен.'); | |
if (answer = '') { | |
console.log('Спасибо. Ввод имен завершен.'); | |
break; | |
} else { | |
names[i] = answer; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment