I'm having a data structure that looks like this:
[
[
{ word: "china", count: 0 },
{ word: "kids", count: 1 },
{ word: "music", count: 0 },
],
[
{ word: "china", count: 3 },
{ word: "kids", count: 0 },
{ word: "music", count: 2 },
],
[
{ word: "china", count: 10 },
{ word: "kids", count: 3 },
{ word: "music", count: 2 },
]
];
I want to calculate the minimum and maximum number of counts for each value of the property word in the nested array.
For example, the maximum counts for the word "china" is 10 and the minimum is 0.
I would like to accomplish something like this:
{ word: "china", min: 0, max: 10 }
How do I do this?