JSFiddle - React, Tailwind, and code Playground

by Diana Lemen

JavaScript

const getPrompt = () => prompt('test', 10);

/* function getPrompt() {
  return prompt('test', 10);
} */

let inputVal = getPrompt();
const newArr = [];
while (inputVal !== null ) {
	newArr.push(inputVal);
	inputVal = getPrompt();
}
console.log(newArr);