Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

random choice js array

function choose(choices) {
  var index = Math.floor(Math.random() * choices.length);
  return choices[index];
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #random #choice #js #array
ADD COMMENT
Topic
Name
6+8 =