JS数组插入方法
Array.prototype.ArrayInsertAfter=function(Num,obj){
var tempArr=new Array();
var l=this.length;
for(var i=0;i<l;i++)
{
tempArr.push(this.shift());
}
l=tempArr.length;
for(var i=0;i<l;i++)
{
this.push(tempArr.shift());
if(i==Num)
{
this.push(obj);
}
}
return this;
}
页:
[1]