Count the number of values

Here is a task to count the number of true in each age:

users = {
 // ...
 age = x; // random number
 sport_life true; // or false
 // ...
}

And display it in a chart (chart.js). Here is how to update.
I don’t know how to put it all together. Thanks in advance!