<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head>
<card title="Array.prototype.remove  删除数组元素" id="card1">
<p> 游客</p><p>
标题:Array.prototype.remove  删除数组元素<br/>
正文:<br/>
来自于jQuery的设计者John Resig：//Array Remove - By John Resig (MIT Licensed)Array.prototype.remove = function(from, to) {    var rest = this.slice((to || from) + 1 || this.length);    this.length = from &amp;lt; 0 ? this.length + from : from;    return this.push.apply(this, rest);};这个函数扩展了JavaScript的内置对象Array，这样，我们以后的所有声明的数组都会自动的拥有remove能力，我们来看看这个方法的用法：var array = [&amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, &amp;quot;three&amp;quot;, &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot;];print(array);array.remove(0);//删除第一个元素print(array);array.remove(-1);//删除倒数第一个元素print(array);array.remove(0,2);//删除数组中下标为0-2的元素(3个)print(array);会得到这样的结果：one,two,three,four,five,sixtwo,three,four,five,sixtwo,three,four,fivefive<br/><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=578&amp;Page=1">[&lt;&lt;]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=578&amp;Page=1">[[1]]</a><a href="http://camnpr.com/wap.asp?mode=WAP&amp;act=View&amp;id=578&amp;Page=1">[&gt;&gt;]</a><br/>
<br/>
<a href="wap.asp?act=Com&amp;id=578">查看评论(0)</a><br/>
<a href="wap.asp?act=AddCom&amp;inpId=578">发表评论</a><br/><br/>

<br/>

<br/>
<a href="http://camnpr.com/wap.asp">首页</a>
</p>
</card>
</wml>