random choice js array

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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