Coding有一个已经排序的数组,比方[1,4,6,9,11,15,18],给你一个新的数,插入到数组中,写一个functionLieme2018-06-062024-01-04123456789101112var arr = [1,4,6,9,11,15,18], key = 10function t(arr,key){ for(var i in arr){ if(arr[i] > key){ return arr.splice(i,0,key) }else{ return arr.push(key) } } return arr}