let yourName;
do {
yourName = prompt("Who are you?");
} while (!yourName);
console.log(yourName);
此代码在在线教科书中给出:https ://eloquentjavascript.net/02_program_struct.html
我还尝试以这种方式在控制台中运行它:
let funGame;
do {
funGame = prompt("enter anything to get rid of this Game");
} while (!funGame);
console.log(funGame);
我正在使用谷歌浏览器来测试这段代码。此代码仅运行一次,而它应该无限期地运行,直到提供空字符串为止。
ABOUTYOU
收到一只叮咚
Qyouu
相关分类