将一个数组插入到另一个数组指定位置

let a = [1,2,3,7,8,9]
let b = [4,5,6]
let insertIndex = 3
a.splice.apply(a,Array.prototype.concat(insertIndex,0,b)) //[1,2,3,4,5,6,7,8,9]

  

posted @ 2022-02-08 18:31  是你吗我笑了  阅读(166)  评论(0)    收藏  举报