Array.prototype.remove = function(el){
    return this.splice(this.indexOf(el),1);
}
var arr = [1,2,3,4,5];
arr.remove(4);
console.log(arr);//[1,2,3,5]

var array = [1,2,3,4,5];
array.splice(2,1);
console.log(array);//[1,2,4,5]

y.splice( $.inArray(removeItem, y), 1 );

和JS 中的JOIN 方法一样,将一数组按照JOIN的参数连接起来。
比如:

var arr = [ "a", "b", "c", "d", "e" ];

document.write(arr.join("-"));

结果:a-b-c-d-e。

http://hlee.iteye.com/blog/1845391

posted on 2014-12-30 16:20  YYDaddy  阅读(168)  评论(0编辑  收藏  举报