random choice js array

Solutions on MaxInterview for random choice js array by the best coders in the world

showing results for - "random choice js array"
Jerónimo
24 Jan 2017
1function choose(choices) {
2  var index = Math.floor(Math.random() * choices.length);
3  return choices[index];
4}
5