I have an array with several dynamically populated numbers. The array
is then sorted to group identical values together.
Let's say my array contains the following:[15,15,35,35,35,35,
35,55,55,75,95,105,115,115,115]
What I need to do is get a count of each number, and determine the
highest frequency, in the above example, the number 35 is listed 4
times, so I would need to set a variable = 4. I've been playing around
with a for loop. Since I have 168 potential matches (15, 35, 55, 75,
95, all the way to 2875) incrementing by 20, that's a bit excessive for
a bunch of if statements. It seems like a nested for loop could do
this, but I can't figure it out. Maybe there's an even better way I
haven't considered.
for (var rowCount:int=0;rowCount < arrayRows.length;rowCount++){
var my15:int;
if (arrayRows[rowCount].row == 15){
my15 = my15+1;
trace (my15);
}
}