//检索重复的行数
function check(receiveArray, checkItem) {
var index = -1; // 函数返回值用于布尔判断
for (var i = 0;i < receiveArray.length; i++) {
if(receiveArray[i] == checkItem) {
index =i;
break;
}
}
return index;
}
//过滤重复的行索引
function getDistinctArray(receiveArray) {
var arrResult = new Array(); //定义一个返回结果数组.
for (var i = 0;i < receiveArray.length; i++) {
if(check(arrResult, receiveArray[i]) == -1) {
// 添加该元素到新数组。如果if内判断为false(即已添加过),则不添加。
arrResult.push(receiveArray[i]);
}
}
return arrResult;
}