Just starting in JS and I'm looking for the basic syntax to extract the number of occurrences (i.e. how often # "2" is found in this array). Very basic but for some reason I'm stuck :(
var myArray = ["1", "5", "1", "1", "5", "2", "4", "5", "2", "3", "2",
"4", "2", "4", "2", "3", "2", "3", "2", "4", "2", "3", "2", "4", "2",
"5", "1", "4", "2", "4", "2", "3", "2", "4", "1", "1", "5", "1", "1",
"1", "5", "2", "4", "5", "2", "3", "2", "4", "2", "4", "2", "3", "2",
"3", "2", "4", "2", "3", "2", "4", "2", "5", "1", "4", "2", "4", "2",
"3", "2", "4", "1", "1", "5", "1", "1", "5", "2", "4", "5", "2", "3",
"2", "4", "2", "4", "2", "3", "2", "3", "2", "4", "2", "3", "2", "4",
"2", "5", "1", "4", "2", "4", "2", "3", "2", "4", "1"];