调用函数过滤封装函数 Array.prototype.unique = function(){ var temp = [], arrs = [], lens = this.length; for (var i = lens - 1; i >= 0; i--) { if (! temp[this[i]]) { temp[this[i]] = 'A'; arrs.push(this[i]); } } return arrs; };
文章评论 (0)