In Javascript, I\'m trying to take an initial array of number values and count the elements inside it. Ideally, the result would be two new arrays, the first specifying each
My solution with ramda:
const testArray = [5, 5, 5, 2, 2, 2, 2, 2, 9, 4] const counfFrequency = R.compose( R.map(R.length), R.groupBy(R.identity), ) counfFrequency(testArray)
Link to REPL.