标签:
var arr = [21, 434, 11, 333, 75, 39, 90, 234, 66, 85];
for(var i = 0; i < arr.length - 1; ++i) {
for(var u = 0; u < arr.length - 1 - i; ++u) {
if(arr[u] > arr[u + 1]) {
var temp = arr[u + 1];
arr[u + 1] = arr[u];
arr[u] = temp;
}
}
}
console.log(arr);
标签:
原文地址:http://www.cnblogs.com/wangchen623/p/5679620.html