title: Count duplicates in an array
body: <p>I'm trying to display the contents of my array but where duplicates exist just print the name and the number e.g</p>
  
  <pre><code>myArr = ['apple', 'apple', 'orange', 'apple', 'banana', 'orange', 'pineapple']
  </code></pre>
  
  <p>Would display; </p>
  
  <pre><code>apple 3
  orange 2
  banana
  pineapple
  </code></pre>
  
  <p>So far I'm returning them all as a string:</p>
  
  <pre><code>arrList = myArr.join(', ');
  arrList.toString()
  </code></pre>