9/9 Limiting user input?


#1

How can I limit user's input to specific words such as "rock" "paper" "scissors"? Is there an specific thread about conditioning prompt functions?

var userChoice = prompt("Do you choose rock, paper or scissors?");

#2

You could make it into a "While" loop, so

while (userChoice != "rock" || userChoice != "paper" || userChoice != "scissors"){
 var userChoice = prompt("Do you choose rock, paper or scissors?");
}