array = ['blue', 'red', 'green', 'green', 'red', 'blue', 'black', 'blue']
…the output I’m trying to achieve would result in
output = ['blue x3', 'red x2', 'green x2', 'black']
I’m having a hard time figuring out the most effective way to do this.
Thanks!
DEMO