Exercise 9 Syntax Error


#1

"Oops, try again. There was a problem with your syntax."
1. I tried to make it clear that the user have to put down new input if they don't use any of "rock" "paper" or "scissors"
2. I tried to rematch the game, if it is a tie.
I was not sure if && is a good choice either

var userChoice = prompt("Do you choose rock, paper or scissors?"){
    //If user makes an inapproriate choice
    if (userChoice != "rock" && userChoice != "paper" && userChoice != "scissors") {
        prompt("Please use validate choice.");
};

var computerChoice = Math.random();

if (computerChoice < 0.34) {
	computerChoice = "rock";
} else if(computerChoice <= 0.67) {
	computerChoice = "paper";
} else {
	computerChoice = "scissors";
}
console.log("Computer: " + computerChoice);

//computerChoice = choice2;
//userChoice = choice1;

var compare = function(userChoice,computerChoice) {
    
    if (choice1 === choice2) {
        return "The result is a tie!"
        //to restart again if it is a tie
        console.log("Rematch!");
        return userChoice;
    }
    
    else  if (choice1 === "rock") {
        
        if (choice2 === "scissors") {
            return "rock wins"
        }
        else {
            return "paper wins"
        }
        
    }
    
    else if (choice1 === "paper") {
        
        if (choice2 === "rock") {
            return "paper wins";
        }
        
    }
    
    if (choice1 === "scissors") {
        
        if (choice2 === "rock") {
            return "rock wins";
        }
        
        else if (choice2 === "paper") {
            return "scissors wins"
        }
        
    }

}


#2

Remove the open bracket in the first line.