我需要一个“do while循环”,直到三个特定单词中的一个写在提示框中。
例如
do
var test = prompt("");
while test =! word1 word2 word3
当写出三个单词中的一个时,脚本应该继续。 我试着超过2个小时,但我仍然没有解决问题。
请帮忙。
答案 0 :(得分:0)
试试这个。
while (test != word1 && test != word2 && test != word3) {
var test = prompt();
}
答案 1 :(得分:0)
使用此:
while (test != word1 && test != word2 && test != word3)