Computer's answer shows like a numbers


#1



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

I've got answers like this
Computer: 0.7798524081543727
"Scissors wins"
How to do the line "Computer: 0.7798524081543727" looks like "Computer:scissors"?

var userChoice = prompt("Rock, Paper, or Scissors?");
var compChoice = Math.random();
if(compChoice <= 1/3) {
    
    compChoice === "rock";
    }
else if (compChoice <= 2/3) {
    compChoice === "paper";
    }
else {
    compChoice === "scissors";
    }
console.log("Computer:" + " " + compChoice);

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


#2

this section of code:

if(compChoice <= 1/3) {
    
    compChoice === "rock";
    }
else if (compChoice <= 2/3) {
    compChoice === "paper";
    }
else {
    compChoice === "scissors";
    }

servers the following purpose: convert the number into rock, paper or scissors. So, you want to update the computerChoice by assign a new value to it, assigning is done with a single equal sign:

compChoice = "paper";

3 equal signs are used for comparison