自己写的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;
}
原文地址:https://www.cnblogs.com/jgjgjg23/p/1627241.html