foreversimon

1、使用concat(原数组不变)

var new = old1.concat(old2)

2、使用for循环(原数组变化)

for (var i=0; i<old2.length; i++) {
  old1.push(old2[i])  
}

3、使用apply(原数组变化)

old1.push.apply(old1,old2) // 把old2合并到old1中

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-12-01
  • 2021-10-12
  • 2022-12-23
  • 2021-12-26
  • 2022-02-04
  • 2022-01-03
猜你喜欢
  • 2021-11-19
  • 2022-01-30
  • 2022-12-23
相关资源
相似解决方案