Array.prototype.unique = function (){ var temp = {}, arr = [], len = this.length; for(var i = 0; i < len; i++){ if(!temp[this[i]]){ temp[this[i]] = ‘abc‘; arr.push(this[i]); } } return arr; }
原文地址:https://www.cnblogs.com/summer-qd/p/10954364.html
时间: 2024-12-09 17:56:08