Finding the mode of an array

I have a simple array and I want to find the most common element in the array, i.e. the mode statistically

Can anyone help?

This is what I have so far,

var answers = [“c”,“b”,“c”,“a”,“b”,“c”,“a”,“b”];
var aTotal = 0;
var bTotal = 0;
var cTotal = 0;
for (i=0; i<=answers.length; i++) {
switch (answers*) {
case “a” :
aTotal++;
break;
case “b” :
bTotal++;
break;
case “c” :
cTotal++;
break;
default :
doNothing();
}
}

stop();

this has worked very well, thanks I have incorporated it with commemnts today
i just had to swap the elements around to bias the results, which turned out to be just what i wanted to do (call me a hustler grin) regards the Project