I have simple array in js
var fruit = [ 'apple' , 'apple' , 'orange' ]
I need this groped so that i can present data in format:
apple 2
orange 1
I have tried with creating two arrays but all got out off control .
See Question&Answers more detail:os