728x90
var thisResult = result;
result = thisResult.filter(function(item1, idx1){
return thisResult.findIndex(function(item2, idx2){
return item1['중복attribute'] === item2['중복attribute']
}) == idx1
});
Array.filter 속성을 활용하면
Array 내에서 특정 attribute에 대한 중복값을 제거할 수 있게 된다.
아래는 테스트 화면
728x90
728x90
'기술공부 > 언어' 카테고리의 다른 글
[Node.js] Express app에서 정적 라우트 경로값을 동적으로 변경하기 (0) | 2023.06.16 |
---|---|
[javascript] Object array 에서 특정 key-value를 만족하는 feature만 추출하기 (0) | 2023.03.03 |
[C#] 라이브러리 만들어보기 - enum(열거형) (0) | 2022.04.26 |
[C#] List slicing - Skip과 Take (0) | 2022.04.02 |
[C#] List정렬 - OrderBy (0) | 2022.03.31 |