title: For loop not waiting for await
body: <p>I am using the "for of" loop. But still, it's not waiting for the dummy function to exit. I was under the assumption that await would wait for the "dummy" function to finish and then use "for of".</p>
  
  <p>Log output:</p>
  
  <pre><code>End wait true
  starting wait
  End wait true
  starting wait
  End wait true
  I am waiting for 925.6301720227887
  I am waiting for 923.6969211579702
  I am waiting for 962.0987671698102
  etc...
  
  
  
  const dummy = async(timeToWait) =&gt; {
      await setTimeout(() =&gt; {
          console.log("I am waiting for", timeToWait);
  
      }, timeToWait);
      return Promise.resolve(true);
  }
  
      // Iterate over the minutes off and get aggregate data
      const computeAggregate = async (model, sym) =&gt; {
  
  
      await model.find({"symbol": sym})
      .sort({trade_ts:1}).exec()
      .then(async (symbol) =&gt; {
          var firstDoc = symbol[0];
          currentMinute = symbol[0].minutes_offs;
          var rec = [];
  
          for (sym of symbol) {
  
              console.log("starting wait");
              let val = await dummy(Math.random() * 1000);
              console.log("End wait", val);
              }
          }
  
      });
  
  }
  </code></pre>