Array.prototype.random = function() { for (var random_i=this.length;random_i>0;random_i--) { this.push(this.splice(Math.floor(Math.random()*random_i),1)[0]); } return this; }