let yourName;
do {
yourName = prompt("Who are you?");
} while (!yourName);
console.log(yourName);
This code is given in an online textbook here: https://eloquentjavascript.net/02_program_structure.html
I have also tried to run it in console in this way:
let funGame;
do {
funGame = prompt("enter anything to get rid of this Game");
} while (!funGame);
console.log(funGame);
I am using google chrome browser to test this code. This code just runs once, while it should run indefinitely until an empty string is provided.