title: How to count certain elements in array?
body: <p>I have an array:</p>
  
  <pre><code>[1, 2, 3, 5, 2, 8, 9, 2]
  </code></pre>
  
  <p>I would like to know how many <code>2</code>s are in the array.</p>
  
  <p>What is the most elegant way to do it in JavaScript without looping with <code>for</code> loop?</p>