Answer the question
In order to leave comments, you need to log in
How to sum all values in a tree?
Good afternoon, there is such an array with a tree object inside:
[
{
"id": 1,
"parentid": null,
"count": "0",
"children": [
{
"id": 2,
"parentid": 1,
"count": "89",
"children": [
{
"id": 3,
"parentid": 2,
"count": "19",
"children": [
{
"id": 5,
"parentid": 3,
"count": "205"
},
{
"id": 4,
"parentid": 3,
"count": "8"
}
]
}
]
}
]
}
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question