Posted in Javascript onJanuary 10, 2013
将数组arr2插入到数组arr1的index位置:
var arr1 = ['a', 'b', 'c']; var arr2 = ['1', '2', '3']; var index = 1; arr2.unshift(index, 0);Array.prototype.splice.apply(arr1, arr2); console.log(arr1);
显示结果:
["a", "1", "2", "3", "b", "c"]
javascript将数组插入到另一个数组中的代码
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@