首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

JavaScript数组增添remove方法

2012-10-25 
JavaScript数组添加remove方法Array.prototype.remove function(from, to) {var rest this.slice((to

JavaScript数组添加remove方法

Array.prototype.remove = function(from, to) {         var rest = this.slice((to || from) + 1 || this.length);         this.length = from < 0 ? this.length + from : from;           return this.push.apply(this, rest);   };

热点排行