title: How to find an item in array which has the most occurrences
body: <p>How do I find an item in array which has the most occurrences?</p>
  
  <pre><code>[1, 1, 1, 2, 3].mode
  =&gt; 1
  
  ['cat', 'dog', 'snake', 'dog'].mode
  =&gt; dog
  </code></pre>