Need help!How to achieve users do not enter the chaos?


#1


var userChoice = prompt("Do you choose rock, paper or scissors?",);
if(userChoice!="rock"){
    if(userChoice!="paper"){
    if(userChoice!="scissors"){
    prompt("Re input");
        }
    }
}
Do the results, the back can not be compared, how to do?


#2

@luandaoya
You will need a combination of
logical operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators
and a while loop ( which you will learn in the next lessons... )
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration

All operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.