logo

Crowdly

Browser

Add to Chrome

What does this code snippet do?  function getComputerChoice() {  const choi...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What does this code snippet do? 

function getComputerChoice() {

 const choices = ["rock", "paper", "scissors"];

 const randomIndex = Math.floor(Math.random() * choices.length);

 return choices[randomIndex];

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.ncst.edu.bh?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome