javascript function that make a choice

JavaScript
function computerplay() {
            choices = ["rock", "paper", "scissors"]
            var ai = choices[Math.floor(Math.random() * choices.length)]
            return ai;
        }
Source

Also in JavaScript: