*SOLVED* 8/9 SyntaxError:Unexpected token {


#1

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";
} console.log("Computer: " + computerChoice);

var compare = function(choice1, choice2) {
if(choice1 === choice2){
return "The result is a tie!"
}
else if(choice2 === "rock"){
if(choice2 === "scissors"){
return "rock wins";
}
else{
return "paper wins";
}
}
else if(choice1 === "paper"){
if(choice2 === "rock"){
return "paper wins";
}
else{
return "scissorss win";
}
}
else(choice1 === "scissors"){
if(choice2 === "rock"){
return "rock wins";
}
else {
return "scissors win";
}
}
}
compare(userChoice, computerChoice)


#2

if(choice1 === choice2){
    return "The result is a tie!"
} else if(choice2 === "rock"){

1.The second line is missing a semicolon.
2.Modify the last line, so it would say: "If the first choice is equal to rock"

} else(choice1 === "scissors") {

Else does not want a condition with him, you check previouly for "paper" and "rock" therefore the "scissors" are the only thing that is left to check.