标签:for pre write document ++ console log i++ i+1
//选择排序
var arNums = [65, 52, 74, 14, -1, 2, 88];
var b = 0;
for (var i = 0; i < arNums.length; i++) {
for (var j = i+1; j < arNums.length; j++) {
if (arNums[i] > arNums[j]) {
a = arNums[i];
arNums[i] = arNums[j];
arNums[j] = a;
}
}
}
for (var i in arNums) {
console.log(i)
if (i != arNums.length - 1) {
document.write(arNums[i] + ‘,‘);
} else {
document.write(arNums[i]);
}
}
标签:for pre write document ++ console log i++ i+1
原文地址:https://www.cnblogs.com/zxk5625/p/10290082.html