How to count the number of certain element in an array?
<p>If I have an array [1, 2, 3, 5, 2, 8, 9, 2], I would like to check how many "2"s in the array, what is the most elegant way to do it in JavaScript without looping with "for" loop?</p>
