//用冒泡排序将数组从小到大排列(打印出来)
let numArr=[5,9,45,87,36,21,85,11,6,50]
for (let j = 0; j < numArr.length - 1; j++) {
for (let i = 0; i < numArr.length - 1 - j; i++) {
if (numArr[i] > numArr[i + 1]) {
let temp = numArr[i];
numArr[i] = numArr[i + 1];
numArr[i + 1] = temp;
}
}
}