没有办法了。不能连续发三帖。。在这里帖帖。Array.prototype的扩展 好,可惜 splice 方法 要求版本 5.5 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 修改成适合版本3<script>function Array.prototype.removeItem(index){ return this.slice(0,index).concat(this.slice(index+1));}function Array.prototype.removeLeft(count){ return this.slice(count);}function Array.prototype.removeRight(count){ return this.slice(0,-count);}var a=[0,1,2,3,4,5];a=a.removeLeft(2)a=a.removeRight(1)a=a.removeItem(1)alert(a)</script> 倒,,上面有个地方帖错了。。帖了两次的indexOf , 应该是这个:function Array.prototype.left(length){ return this.slice(0,length);}function Array.prototype.mid(start,length){ return this.slice(start,start+length);}function Array.prototype.right(length){ if(length>=this.length)return this.concat(); return this.slice(this.length-length,this.length);} js 判断函数是否运行 高手来帮我改改,应该是层的问题、 请教Jquery问题 在地址拦运行js与在页面里运行js有啥区别?我这有个实例,请说明一下 窗口关闭的问题!急 如何让菜单显示在主页最上层 问一下,可以用javascript计下载次数吗 你知道结婚有多难吗?再贺MEIZZ 新浪论坛里面的树型和那两个蓝色的三角形所实现的功能是怎样实现的?大家有没有兴趣分析一下啊?? 定义数组的问题 关于file控件的使用 请问各位,浮动工具栏怎么做?
function Array.prototype.removeItem(index){
return this.slice(0,index).concat(this.slice(index+1));
}
function Array.prototype.removeLeft(count){
return this.slice(count);
}
function Array.prototype.removeRight(count){
return this.slice(0,-count);}var a=[0,1,2,3,4,5];
a=a.removeLeft(2)
a=a.removeRight(1)
a=a.removeItem(1)
alert(a)
</script>
function Array.prototype.left(length)
{
return this.slice(0,length);
}
function Array.prototype.mid(start,length)
{
return this.slice(start,start+length);
}
function Array.prototype.right(length)
{
if(length>=this.length)return this.concat();
return this.slice(this.length-length,this.length);
}