//获取数组内所有重复元素,并以数组返回
//例:入参数组['1','2','4','7','1','2','2'] 返回数组:['1','2']
function GetRepeatFwxmmc(ary1){
var ary = ary1.sort();//数组排序
var cffwxmsAry = new Array();
//所有重复元素添加进新数组内
for(var i=0;i<ary.length;i++){
if (ary[i]==ary[i+1]){
cffwxmsAry.push(ary[i]);
}
}
var result = [], isRepeated;
//对重复元素数组进行元素去重
for (var k = 0; k < cffwxmsAry.length; k++) {
isRepeated = false;
for (var j = 0;j < result.length; j++) {
if (cffwxmsAry[k] == result[j]) {
isRepeated = true; break;
}
}
if (!isRepeated) {
result.push(cffwxmsAry[k]);
}
}
return result;
}