I have an array of objects like this [Object, Object, Object]
the structure of every object like this
0: Object
children: Array[0]
node_id: 0
parent_id: -2
text: "(r , e , w)"
value: 6
1: Object
children: Array[0]
node_id: 1
parent_id: 0
text: "(r)"
value: 3
2: Object
children: Array[0]
node_id: 2
parent_id: 0
text: "(e , w)"
value: 3
first I have for loop and I want to get parent_id every iteration
second I want to put last two objects into the children array inside first object Any help appreciated.