//js冒泡排序
window.οnlοad=function(){
var arr=[5,4,1,3,2];function mysort(){
for(var i=0;i<this.length;i++){
for(var j=0;j<this.length-1;j++){
if(this[j]>this[j+1]){
var temp = this[j];
this[j] = this[j+1];
this[j+1] = temp;
}
}
}
return this;
}
alert(typeof mysort);
Array.prototype.mysort=mysort;
alert(arr.mysort());
}