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

js操作Array数组剔除元素等操作

2013-02-24 
js操作Array数组删除元素等操作Array.prototype.clearfunction(){ this.length0 } Array.prototype.ins

js操作Array数组删除元素等操作
Array.prototype.clear=function(){ this.length=0; } Array.prototype.insertAt=function(index,obj){ this.splice(index,0,obj); } Array.prototype.removeAt=function(index){ this.splice(index,1); } Array.prototype.remove=function(obj){ var index=this.indexOf(obj); if (index>=0){ this.removeAt(index); } }

?

热点排行
Bad Request.