Recently delved into the world of Ramda
and am on a quest to discover a pointfree method for reducing an array of objects.
Behold, the array of objects :
const someObj = [
{
name: 'A',
city: 1,
other: {
playtime: 30
}
},
{
name: 'B',
city: 2,
other: {
playtime: 20
}
},
{
name: 'c',
city: 1,
other: {
playtime: 20
}
}
];
I aspire to achieve object reduction with the wondrous powers of Ramda, all while maintaining the pointfree style like so:
{
'1': {
count: 2,
avg_play_time: 20 + 30 / count
},
'2': {
count: 1,
avg_play_time: 20 / count
}
}
The conventional method involving array reduction is within my grasp, but the enigma lies in crafting the same utilizing Ramda's unmistakable pointfree elegance. Any guidance on this matter would be greatly valued.