标签:style blog io color ar for sp div on
//数组去重 Array.prototype.unique5 = function() { var res = [], hash = {}; for(var i=0, elem; (elem = this[i]) != null; i++) { if (!hash[elem]) { res.push(elem); hash[elem] = true; } } return res; } var arr=[1,2,3,4,5,6,7,2,3,4,2,5]; alert(arr.unique5());
标签:style blog io color ar for sp div on
原文地址:http://www.cnblogs.com/fan-fan/p/4063130.html