------解决方案--------------------
模仿了一下splice函数
var $a =[1,2,3];
var $b = [4,5,6];
$b.unshift(0,0);
//$a.splice(0,0,'jiang',6,9);
Array.prototype.splicexx = function(start,deletecount){
var items,len1,lenthis,cloneitem,newitem;
newitem = [];
items = Array.prototype.slice.call(arguments,2);
len1 = items.length;
lenthis = this.length;
for(var i=0;i<lenthis;i++){
if(i == start){
for(var j=0;j<len1;j++){
newitem.push(items[j]);
}
for(var k=0;k<deletecount;k++){
i++;
}
}
newitem.push(this[i]);
}
return newitem;
}
var $c = $a.splicexx.apply($a,$b);
var $x = 'ddd';
------解决方案--------------------
var arr1=[1,2,3]
var arr2=[4,5,6]
arr2/unshift(0,0) //arr2=[0,0,4,5,6]
arr1.splice.apply(arr1,arr2)
// arr1=arr1.splice(0,0,4,5,6)
//从arr1索引0开始.去除0个元素,插入arr2
// arr1=[4,5,6,1,2,3]
arr3=[11,12,13]
arr4=[21,22,23]
arr4.unshift(1,0) //arr4=[1,0,21,22,23]
arr3.splice.apply(arr3,arr4)
//arr3=arr3.splice(1,0,21,22,23)
//arr3=[11,21,22,23,12,13]