var arr=[1,2,3,4,5,6,7,8,9];
Array.prototype.remove=function (index) {
var value=this[index];
var list=[];
for (var i=0; i<this.length; i++) {
if (i>=index) {
this[i]=this[i+1];
}
}
this.pop();
return value;
};
Array.prototype.randomList=function () {
var randomList=[];
while (this.length>0) {
var random=Math.floor(Math.random()*this.length);
randomList.push(this.remove(random));
}
return randomList;
}
alert(arr.randomList())