# To get array of all meshes

**URL:** <https://discourse.threejs.org/t/to-get-array-of-all-meshes/17458>\
**Category:** Questions\
**Tags:** object3d\
**Created:** [July 28, 2020, 7:07am UTC](https://discourse.threejs.org/t/to-get-array-of-all-meshes/17458 "2020-07-28T07:07:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [July 28, 2020, 7:15am UTC](https://discourse.threejs.org/t/to-get-array-of-all-meshes/17458/2 "2020-07-28T07:15:51Z")

</div>

You could do something recursive if the child has children of its own:

```auto
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);

```

---

_[View the full topic](https://discourse.threejs.org/t/to-get-array-of-all-meshes/17458)._
