var arry =[1,2,3,5,7,2,13,3];
for(var i=0;i<arry.length;i++){
for(var j =i+1;j<arry.length;j++){
if(arry[j]<arry[i]){
var c=arry[i];
arry[i]=arry[j];
arry[j]=c;
}
}
}
console.log(arry);
标签:ons 排序 js排序 body gpo i++ div var console
var arry =[1,2,3,5,7,2,13,3];
for(var i=0;i<arry.length;i++){
for(var j =i+1;j<arry.length;j++){
if(arry[j]<arry[i]){
var c=arry[i];
arry[i]=arry[j];
arry[j]=c;
}
}
}
console.log(arry);
标签:ons 排序 js排序 body gpo i++ div var console
原文地址:https://www.cnblogs.com/a8497336/p/8304115.html