티스토리 뷰

공부

[JS] uniqBy array by Lodash

승가비 2020. 5. 17. 04:52
728x90
_.uniqBy(data, function (e) {
  return e.id;
});

_.uniqBy(data, 'id');

https://stackoverflow.com/questions/31740155/lodash-remove-duplicates-from-array

 

Lodash remove duplicates from array

This is my data: [ { url: 'www.example.com/hello', id: "22" }, { url: 'www.example.com/hello', id: "22" }, { url: 'www.example.com/

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[JS] check isEmpty  (0) 2020.05.17
[SpringBoot] configuration memory heap size  (0) 2020.05.17
[Spark] submit conf by tuning  (0) 2020.05.14
[Chrome] active tab execute command  (0) 2020.05.14
[JS] scroll go to edge  (0) 2020.05.14
댓글