title: Sorting array of objects into an array of paired objects with Javascript
body: <p>I have an array of objects and I want to be able to sort them by their &quot;site&quot; value into pairs. There can't be more that 2 objects in each child array so if there is 3 matches I get 1 child array with 2 objects and 1 child array with 1 object.</p>
  <p>I have:</p>
  <pre><code>[{site:'A'}, {site:'A'}, {site:'B'}, {site:'B'}, {site:'B'}];
  </code></pre>
  <p>I want:</p>
  <pre><code>[[{site:'A'}, {site:'A'}],[{site:'B'}, {site:'B'}], [{site:'B'}]] 
  </code></pre>
  <p>Whats the best way to do this? any help is appreciated.</p>