title: In Promise loop, how to wait on request response?
body: <p>I'm trying to make a loop that sends requests.</p>
  
  <p>However, I would like to wait to receive the answer of the request before sending the next one. How can I proceed?</p>
  
  <pre><code> private start(): Promise&lt;string&gt; {
      return new Promise((resolve, reject) =&gt; {
        for (let j = 0, p = Promise.resolve(); j &lt; count; j++) {
          p = p.then(_ =&gt; new Promise&lt;null&gt;(res =&gt;
            setTimeout(() =&gt; {
              if (j === (count - 1)) {
                resolve();
              } else {
                this.http.get();
                res();
              }
            }, 1000)
          ));
        }
      });
    }
  </code></pre>
  
  <p>Thanks for helping</p>