7/8 sintax error


#1

var choice1 = prompt("Do you choose rock, paper or scissors?");
var choice2 = Math.random();
if (choice2 < 0.34) {
choice2 = "rock";
} else if(choice2 < 0.67) {
choice2 = "paper";
} else {
choice2 = "scissors";
}
console.log("Computer: " + choice2);
function(choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie!";
}
else if(choice1 === "rock") {
if(choice2 === "scissors") {
return "rock wins";
} else {
return "paper wins";
}
}
else if(choice1 = "paper") {
if(choice2 = "rock") {
return "paper wins";
}
else {
return "scissors win";
}
}
};
console.log(compare);


#2

Your function syntax is incorrect..

You have:
function(choice1, choice2) {
It should be
var Name = function() {
or
function Name() {

Also I noticed your else if statement condition is wrong. your assigning a value to choice 1 and choice2 instead of evaluating it. make sure to put two or three equal signs to evaluate. ==, ===. A single equal sign = is used for assignment purposes.