title: Count occurring pairs in array - Javascript
body: <p>I want to find and count the pair of values within an array.</p>
  
  <p>For example:</p>
  
  <pre><code>var Array = ["Apple", "Pear", "Mango", "Strawberry", "Apple", "Pear", "Orange"];
  </code></pre>
  
  <p>Now I want to count how many times each pair (Apple and Pear, Pear and Mango and so on...) occurs in the array. If the array has uneven pair, the last value should then be zero.</p>
  
  <p>The output of the array in the example should then be:</p>
  
  <pre><code>[2,1,1,1,1]
  </code></pre>
  
  <p>Notice that the "Apple, Pear" occurs 2 times so then the count will be two and put in the first number of the new array. </p>
  
  <p>I hope I explained good enough</p>