// Define random() method of Arrays
Array.prototype.random = function() {
return this[Math.floor(Math.random() * this.length)];
}
console.log([1, 2, 3, 4, 5, 6].random()); // 5 for example
console.log(['apple', 'banana', 'orange'].random()); // 'orange' for example