title: How do I clear this array each time the inner loop finishes?
body: <p>I need some help with these async loops. Each object has a materials array inside. I need to clear objectRedirects each time the materials loop ends.</p>
  
  <pre><code>  objects.map(async object =&gt; {
        objectRedirects = [];
  
        await Promise.all(
          object.materials.map(async material =&gt; {
            const childObject = await ItemObject.findOne({
              name: object.name,
              material: material
            })
              .lean()
              .exec();
  
            objectRedirects.push(childObject);
          })
        );
      });
  </code></pre>
  
  <p>Currently objectRedirects will never be cleared or reset back to an empty array it will continue adding the 'materials' of each 'object'</p>