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中

 

分类:

技术点:

相关文章:

  • 2021-11-19
  • 2021-11-19
  • 2021-11-11
  • 2021-10-07
  • 2021-11-12
猜你喜欢
  • 2021-11-19
  • 2021-12-26
  • 2021-11-19
  • 2021-11-19
  • 2021-11-05
  • 2021-12-15
  • 2021-11-06
相关资源
相似解决方案