I\'m kind of new to JavaScript. I just started learning it, and I decided to make a \'Rock, Paper, Scissors, Lizard, Spock\' game. Here is the code:
var use
I would write a function to get the correct response instead of doing it all inline.. that's just me..
function getUserChoice(){
var invalidPin = true;
var response;
while(invalidPin){
response = prompt("choose your thing..");
if(response == "rock" || response == "paper" || response == "scizerz"){
invalidPin = false;
}
}
}
return response;
}
then you can get the user's choice simply by calling the function
var userChoice = getUserChoice();