Answers for "array of array duplicate values count to push js"

0

duplicate numbers in an array javascript

[1, 1, 2, 2, 3].filter((element, index, array) => array.indexOf(element) !== index) // [1, 2]
Posted by: Guest on November-10-2020
0

how to count duplicates in an array javascript

arr.reduce((b,c)=>((b[b.findIndex(d=>d.el===c)]||b[b.push({el:c,count:0})-1]).count++,b),[]);
Posted by: Guest on December-16-2020

Code answers related to "array of array duplicate values count to push js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language