var objTree = {.....}objTree.map(v => ({...v,children: v.children.map(o => ({...o,children:null}))}))