Unable to get a random string selection from my JavaScript array using the Math.Random function

Viewed 18

I am trying to get a random input for my rock paper scissors game, but the console just returns 0 every time I call the function.

function computerPlay() {
    options = ["rock", "paper", "scissors"]
    let computerSelection = Math.floor(Math.random(options.length));
    console.log(computerSelection);
}
0 Answers
Related