I have the following JSON object returned by an API call

```
Object {Result: Array[5]}
Result: Array[5]
0: Object
  id: 1
  name: "Mark"
  joinDate: 2014-05-03T22:12:05.000Z
  balance: 2201
1: Object
2: Object
3: Object
4: Object
5: Object
length: 5
__proto__: Array[0]
__proto__: Object

```

I need to group the data here and produce a new object grouping number of clients and their balances in each day of the month. So that I end up with an object that has (assuming I am producing an object for May based on the object above):

```
{
   0:Object
    id: 1 >> Referring to Day 1 of the month
    nof_of_clients: 5
    total_balance: 30,899
   1:Object
    id: 2 >> Referring to Day 2 of the month
    nof_of_clients: 12
    total_balance: 20000
   2:Object
    id: 5 >> Referring to Day 5 of the month
    nof_of_clients: 2
    total_balance: 1200
}

```

So I was wondering is it possible to do this by Javascript and if yes, how? Any example will be highly appreciated. Thanks