I am making a random letters generator. It has to find a given word in the least amount of tries. It lists the number of tries everytime in an array. I want to get the least frequent value in the array.
I already got the most frequent value to work with this
I tried this for lowest frequency but it doesn't work and gives me the last item, with 1 occurence everytime :
var mif = 1;
var itemin;
if (m <= mif) {
mif = m;
itemin = generations[i];
}