I\'m trying to count duplicates in an array of dates and add them to a new array.
But i\'m only getting the duplicates and the amount of times they exist in the array. <
I would do like this
var arr = ["a", "a", "b", "c", "c", "a"], red = arr.reduce((p,c) => (p[c]++ || (p[c]=1),p),{}); console.log(red);