Select Random Item from an Array

0
0

var myArray = [
  "Apples",
  "Bananas",
  "Pears"
];

var randomItem = myArray[Math.floor(Math.random()*myArray.length)];
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.