Here you can find the source of random()
Array.prototype.random = function(){ return this[Math.round(Math.random()*(this.length-1))] }
Math.randomInt = function (min, max) { return Math.round(Math.random() * (max - min) + min); }; Array.prototype.random = function () { this[Math.randomInt(0, this.length-1)];
Array.prototype.random = function () { return (this[(Math.max(Math.random() * this.length - 1, 0).toFixed())]) } Array.prototype.fillNull = function(){this[].fill(function(){return null})} Array.prototype.bool = function () { return this.map(function (v) { return v ? true : false }) } Array.prototype.a01 = function () { return this.map(function (v) { return v ? 1 : 0 }) } Array.prototype.splitToChunks = function (num) { var ret = [] for (var i = 0; i < this.length / num; i++) { ret.push(this.slice(i * num, i * num + num)) return ret Array.prototype.removeByIndex = function (index) { return this.splice(index, 1) Math.myRandom = function (max, min) { if(max == undefined) return Math.random() if(min == undefined) return Math.random() * max; return Math.random() * (max+-min) + min;
Array.prototype.random = function () { var i, j, k, ti, tj; for (k = 0; k < this.length; k++) { i = this.length; while (--i) { j = Math.floor(Math.random() * (i - 1)); ti = this[i]; tj = this[j]; this[j] = ti; ...
window.console = window.console || {'log':function(){}} function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; Array.prototype.random = function () { return this[Math.random() * this.length - 1 | 0]; }; Array.prototype.subRandom = function () { var length = randomInt(0, this.length) ...
Array.prototype.random = function() { return this[Math.floor(Math.random() * this.length)]; Number.prototype.toPrice = function() { return this.valueOf().toFixed(2).replace(/./g, function(c, i, a) { return i && c !== "." && !((a.length - i) % 3) ? "," + c : c; });
Array.prototype.random = function() return this[Random(0, this.length - 1)];
Array.prototype.random = function() { if (this.length == 0) return void 0; return this[Math.floor(Math.random() * this.length)]; };
Array.prototype.random = function(i) { var random = []; for(; i > 0;) { random.push(this[Math.random() * this.length | 0]); i--; return random; }; var usedNames = {}; ...
Array.prototype.random = function(last) { var num = 0; do { num = Math.floor(Math.random() * this.length); } while (this[num] == last); return this[num];