Random array element - Node.js Array

Node.js examples for Array:Random Array

Description

Random array element

Demo Code


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

Related Tutorials