Get random value from Array - Node.js Array

Node.js examples for Array:Random Array

Description

Get random value from Array

Demo Code

Array.prototype.random = function() {
  return this[Math.random()*this.length|0];
}

Related Tutorials