Complete rock paper scissor 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";
} console.log("Computer: " + computerChoice);*/
var compare = function (choice1, choice2)
if (choice1 === choice2) {
console.log("The result is a tie!");
else if (choice1 === "rock") {
if (choice2 === "scissors") {
console.log("rock wins");
else {
console.log( "paper wins" )


What is this? A question? A solution? A request?

If it is a request: The answer is no. Try it yourself make the mistakes you make we might give you hints and explanaitions but a necessary step in learning is making your own mistakes.

if it is a solution: Please refrain from this. As said making mistakes is part of the learning experience. Also it is not always secure that the posted code is correct or that it is helpful. The exercises are short and therefore all look pretty similar so giving a clear hint is better than posting a non commented solution. Last but not least the exercises are doable and if they're not it's better to report this than using a walkaround

if it is a question: Please give more information e.g. the exercise name/number, the error message. What you tried what went wrong aso the more and specific your informations are the better other people can see your problem and give you hints about it.