let arr = []; let index = 0; while (true) { arr.push(prompt('Напишите елемент масива')); if(arr[index] === null) { break; } index++; }