1var word = ['Rock', 'Paper', 'Scissor'];
2var words = word[Math.floor(Math.random()*word.length)];
3alert('The computer chose:' + word);
4
5// Be sure to add more to the string values if you wish to add more words.
1// function for selecting a random index from an array
2const pickOne = (arr) => arr[Math.floor(Math.random() * arr.length)];
3
4let choice = pickOne(["Apple", "Banana", "Orange"]);