✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
function getComputerChoice() {
const choices = ["rock", "paper", "scissors"];
const randomIndex = Math.floor(Math.random() * choices.length);
return choices[randomIndex];
}