Need an algorithm to manipulate array structure in javascript
<p>In javascript, here is my start array:</p>

<pre><code>[{
   name: 'aaa',
   value: 1
 },
 {
   name: 'bbb',
   value: 0
 },
 {
   name: 'bbb',
   value: 1
}]
</code></pre>

<p>I want to transform it into this array as result:</p>

<pre><code>[{
   name: 'aaa',
   value: 1
 },
 {
   name: 'bbb',
   value: [0, 1]
 }]
</code></pre>

<p>I need a good and simple algorithm to do this</p>
