I have pushed a random amount of strings into an array.
var array = ["car", "plane", "plane", "car", "car"];
Id like to retrieve the Arrays values and get the amount of times they were pushed into the Array. i.E
var a = "car";
var aCount = 3;
var b = "plane";
var bCount = 2;
var text = "'" + a + "'" + " was found " + aCount + " times";
return text
I dont see how i can use a loop to compare array[i] with all the other values of the array, especially considerung array.length is randomly determined ?
thank you