So, I have a prompt box in my program (using JavaScript) asking the user to enter their name (for this example), which will loop 5 times to gather 5 names. If they hit cancel, I want it to come up with an additional prompt box telling the user that a name was not supplied. How would I go about doing this?
for (let i = 0; i < 5; i++) {
let name = '';
while (name === '') {
name = prompt('Enter name', '');
}