please have a look on my if condition. I am just refreshing my javascript and I am wondering, how I could check, if the inserted variables, are the ones I want to be used.>
function compare(choice1, choice2){
var identical = choice1 === choice2;
var options = ["rock", "paper", "scissors"];
if (identical && (options.indexOf(choice1) > -1))
alert("Pass");
else
alert("Not alike");
}
In this code, identical will be either true or false, and if it is true, you can check if it matches any of the values inside the options array.