Rock Paper Scissors Game


#1



Any help with what is wrong with my code is appreciated.

https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/1?curriculum_id=506324b3a7dffd00020bf661

SyntaxError: Unexpected token if

Replace this line with your code. 
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice <0.34){
    computerChoice = "rock";
}else if(computerChoice <=0.67){
    computerChoice = "paper";
}
else{
    computerChoice = "scissors";
}
var compare = function(user, computer)
if(user === computer) {
    return("Its a Tie!")
}
if(user === "rock") {
    if(computer === "scissors") {
        return("User Wins!")
    }
    else {
        return("Computer Wins!")
    }
}
if(user === "scissors") {
    if(computer === "rock") {
        return("Computer Wins!")
    }
    else {return("User Wins")}
}
else {
    if(computer === "rock") {
    return("User Wins!")
}
    else {
        return("Computer Wins!")
    }
    
}
compare(userChoice, computerChoice)


#2

you gotta use { when you're creating function (after user,computer)

second issue is you gotta use else if after first if statement