Here you can find the source of random()
// Legacy's stock Array.prototype.random = function() { return this[Math.floor(Math.random() * this.length)]; };
Array.prototype.random = function() { if (Object.prototype.toString.call(this) !== '[object Array]') { throw new TypeError("`this` must be Array, not " + typeof this); return this[Math.floor(Math.random() * this.length)]; };
Array.prototype.random = function() { return this[ Math.randomInt( 0, this.length - 1 ) ]; };
Array.prototype.random = function () { return this[ (Math.random() * this.length).floor() ]; };
Array.prototype.random = function() { if (!this.length) { return null; } return this[Math.floor(ROT.RNG.getUniform() * this.length)];
Array.prototype.random = function(){ return this[sb.math.rand(0,this.length)]; };
Array.prototype.random = function() { return this[Math.rand(0, this.length)];
Array.prototype.random = Array.prototype.random || function() { if (!this.length) { return null; } return this[Math.floor(ROT.RNG.getUniform() * this.length)];
Array.prototype.random = function() { if (this.length === 0) { return null; if (this.length === 1) { return this[0]; return this[Math.floor(RougeLib.RNG.random() * this.length)]; }; ...
var colors = ["#FFBF00", "#0080FF","#01DF3A","#FF0080"] Array.prototype.random = function(){ return this[Math.floor(this.length * Math.random())]