I have a JSON end point for projects in a county. I am able to call a list of any of the object properties. What I want to do is to add together either all the values of budget property or the spent_encumbered by the value of category property.
For example, the total cost of all the projects that were for bridges, general county projects, school systems projects, etc.
Ideas I’ve had:
- Return all the values of the category property
- Push them all to an array
- Do an if statement,
if data[i].category === "school system projects"// or whatever array value? For loopto add up all the returned budget values for the specific category.
Thoughts?






