Js:数组的各种方法范例pop,push,unshift,splice,shift
<script> Array.prototype.pop=function(){ if(this.length!=0)this.length--; return this; } /* pop 方法 移除数组中的最后一个元素并返回该元素。 arrayObj.pop( ) 必选的 arrayObj 引用是一个 Array 对象。 说明 如果该数组为空,那么将返回 undefined。 */ var a=[1,2,
原创
2010-12-18 09:45:00 ·
461 阅读 ·
0 评论