Created
December 7, 2018 17:11
-
-
Save masterfermin02/a43beab13719e131b6546c099b1213d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function frequency(array_elements){ | |
return array_elements.sort().reduce((b,c)=>((b[b.findIndex(d=>d[0]===c)]||b[b.push([c,0])-1])[1]++,b),[]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment