You could do something recursive if the child has children of its own:
function listChildren(children) {
let child;
for (let i = 0; i < children.length; i++) {
child = children[i];
// Calls this function again if the child has children
if (child.children) {
listChildren(child.children);
}
// Logs if this child last in recursion
else {
console.log('Reached bottom with: ', child);
}
}
}
listChildren(scene.children);