How to group and self join an array of objects in javascript
I have an array of objects that looks like this: [ {date: '2022-12-07', type: 'freeze', value: 3}, {date: '2022-12-06', type: 'freeze', value: 1}, {date: '2022-12-05', type: 'freeze', value: 1}, {date: '2022-12-04', type: 'boil', value: 1}, {date: '2022-12-04', type: 'freeze', value:…