NodeJS promise resolution
<pre><code>const a = [1, 2, 3, 4, 5];

const f = () =&gt; new Promise((resolve, reject) =&gt; resolve(4));

const g = () =&gt; {
  Promise.all(a.map((member) =&gt; f().then((res) =&gt; res)))
    .then((result) =&gt; {
      console.log(result)
    });
}

g();
</code></pre>

<p><strong>Why do I not</strong> need another then attached to <code>{return res;}</code> here?</p>

<p>I read that when you have a <code>return (something)</code>inside a then, another <code>then</code> must be attached, but its not the case here. Help?</p>