📅  最后修改于: 2022-03-11 15:02:50.388000             🧑  作者: Mango
function getIndexToIns(arr, num) {
arr.sort((a, b) => a - b);
for (let i = 0; i < arr.length; i++) {
if (arr[i] >= num)
return i;
}
return arr.length;
}