请教:用forEach简写了for循环,如下,还可以怎么继续简化(不用递归)?

_DATA.forEach( (value, index) =>{
const children = [];
value.child.forEach( (value2, index2) =>{
children.push({
title:value2.name,
id:value2.id,
key:0-${index}-${index2},
selectable: true
})
})
DATA2.push({
id:value.id,
title:value.name,
children:children,
key:0-${index},
selectable: true
})
});

_DATA.forEach((value, index) => {
    DATA2.push({
        id: value.id,
        title: value.name,
        children: value.child.map((value2, index2)=>({
            title: value2.name,
            id: value2.id,
            key: `0-${index}-${index2}`,
            selectable: true
        })),
        key: `0-${index}`,
        selectable: true
    })
});