js 数组去掉重复数据----去重
// //去掉重复//
var specvalue=[1,2,3,4,5]//数组
Array.prototype.distinct = function () {
var arr = this,
result = [],
i,
j,
len = arr.length;
for (i = 0; i < len; i++) {
for (j = i + 1; j < len; j++) {
if (arr[i] === arr[j]) {
j = ++i;
}
}
result.push(arr[i]);
}
return result;
}
var lstValue = specvalue.distinct();//调用该方法引用