I have an array of objects having a boolean field X. [{..., x: true, y: 3, ...]
I need to aggregate this array, in order to obtain a value, true(or false), if all values of x are correspondingly true(or false), otherwise undefined... and a sum of y's...
is that possible to use the reduce Array function, groupby by underscorejs, or another one for this purpose?
ex:
[
{a:'titi', x: true, y: 3},
{a:'toto', x: false, y: 6}
]
result
{x: undefined, y: 9}