View Single Post
Old 12-03-2012, 01:56 PM   PM User | #25
007julien
Regular Coder

 
Join Date: May 2012
Location: France
Posts: 122
Thanks: 0
Thanked 18 Times in 16 Posts
007julien is an unknown quantity at this point
Thanks ! is it very necessary to return many values with map ?

Code:
var r=[ 77, 101, 141, 91, 91, 191, 191, 343, 44, 44, 65 ],lttFrq=[];// an array or an object
   function count(a){lttFrq[a]?lttFrq[a]+=1:(lttFrq[a]=1);}
   r.map(count);
   alert(lttFrq);
Then (for IE only9 web users) filter give the «dominant» value, or all others frequencies...
007julien is offline   Reply With Quote