1 /* 2 * concat()/join()/pop()/push()/reverse()/shift() 3 * slice()/sort()/splice()/toSource()/toLocaleString() 4 * unshift()/ 5 */ 6 7 /*扩展获取长度方法*/ 8 Array.prototype.Length = function() { 9 return this.length; 10 } 11 12 /*扩展数组指定位置插入方法*/ 13 Array.prototype.ListInsert = function(value,position){ 14 /* 15 * 插入过程中,先水平移动再插入 16 */ 17 var len = this.length-1; //记录数组长度,为获取最后一位数据做准备 18 var mv_len = this.length - position; //水平移动位移 19 var in_pos = position; //插入位置 20 21 //判断插入的是number/object/array 22 //function,string也具有length属性 23 if(value.length === undefined || typeof(value) === 'string' || typeof(value) === 'function'){ 24 var in_len = 1; 25 }else{ 26 var in_len = value.length; //需要插入元素的长度 27 } 28 29 //第一次循环水平移位 30 for(var i=mv_len; i>0; i--){ 31 this[len+in_len] = this[len--]; 32 } 33 34 //第二次循环插入数据 35 for(var i=0; i= this.length) 82 return -1; 83 return this[this.LocateElem(cur_e)+1] 84 } 85 86 /*扩展的数组元素删除方法*/ 87 Array.prototype.ListDelete = function(indx) { 88 for(var i=indx; i