js prototype原型对象用处
Array.prototype.pushEx = function(obj){ var a = true; for (var i = 0; i < this.length; i++) { if (this[i]== obj) { this[i] = obj; a =false; break; } } if(a){ this.push(obj); } return this.length;}var test1 = new Array();test1.pushEx("bb");test1.pushEx("bb");test1.pushEx("dd");alert(test1) //bb,dd