score:1

Accepted answer

Your current code is trying to use push() on the jdata object, which is not an array.

I believe that you want to push the new json.children objects into the jdata.children array (untested)

jdata.children.push(json.children)

Related Query

More Query from same tag