How find sum of all value in that object? In object included array with another object with value and may be "next" array with similar structure object.
{
value: 4,
next: [
{
value: 3,
next: [...]
},
{
value: 3,
next: [...]
},
...
]
}