数组去重
public quchong(arr): any { let hash = []; for (var i = 0; i < arr.length; i++) { if (arr.indexOf(arr[i]) == i) { hash.push(arr[i]); } } return hash; }
山重水复疑无路,柳暗花明又一村!
专注填坑,少走弯路!
public quchong(arr): any { let hash = []; for (var i = 0; i < arr.length; i++) { if (arr.indexOf(arr[i]) == i) { hash.push(arr[i]); } } return hash; }