title: Array reduce function with async await
body: <p>I'm trying to skip one object from an array objects based on a async operator. I've tried following cases, but getting a Type error.</p>
  
  <p>Tried Method 1</p>
  
  <pre><code>newObjectArray = await Promise.all(objectAray.reduce(async (result, el) =&gt; {
    const asyncResult = await someAsyncTask(el);
    if (asyncResult) {
        result.push(newSavedFile);
    }
    return result;
  }, []));
  </code></pre>
  
  <p>Tried Method 2</p>
  
  <pre><code>newObjectArray = await Promise.all(objectAray.reduce(async (prevPromise, el) =&gt; {
    const collection = await prevPromise;
    const asyncResult = await someAsyncTask(el);
    if (asyncResult) {
        prevPromise.push(newSavedFile);
    }
  
    collection.push(newSavedFile);
    return collection;
  }, Promise.resolve([])));
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>'TypeError: #&lt;Promise&gt; is not iterable',
  '    at Function.all (&lt;anonymous&gt;)',
  </code></pre>