[JAVASCRIPT] 배열의 중복값 필터 하기
function f_getUniqueArray(data, groupStr){ var uniqueNames =[]; $.each(data, function(index, item){ var group = item[groupStr]; //21 if($.inArray(group, uniqueNames) === -1) uniqueNames.push(group); }) return uniqueNames; } data = Array값 groupStr 필터랑 할 데이터 ex) data = [ {name='A', date='2019'}, {name='B', date='2019'}, {name='C', date='2019'}, {name='D', date='2019'}, {name='E', date='2019'}, {na..
PROGRAMMING/JAVASCRIPT
2020. 2. 21. 16:48