插入排序
function insertSort(arr) {
var res = [arr[0]];
for (let i = 1, len = arr.length; i < len; i++) {
let temp = arr[i];
for (let j = i - 1; j >= 0; j--) {
console.log(res[j], arr[i]);
if (res[j] > temp) {
res[j + 1] = res[j];
res[j] = temp;
} else {
res[j + 1] = temp;
break;
}
}
}
return res;
}