Get random element from JavaScript array Array.prototype.randomize = function () { return this[Math.floor((Math.random()*this.length))]; } let arrays = Array('me', 'you', 'us', 'people') arrays.randomize()