title: Using async/await with a forEach loop
body: <p>Are there any issues with using <code>async</code>/<code>await</code> in a <code>forEach</code> loop? I'm trying to loop through an array of files and <code>await</code> on the contents of each file.</p>
  <pre><code>import fs from 'fs-promise'
  
  async function printFiles () {
    const files = await getFilePaths() // Assume this works fine
  
    files.forEach(async (file) =&gt; {
      const contents = await fs.readFile(file, 'utf8')
      console.log(contents)
    })
  }
  
  printFiles()
  </code></pre>
  <p>This code does work, but could something go wrong with this? I had someone tell me that you're not supposed to use <code>async</code>/<code>await</code> in a higher-order function like this, so I just wanted to ask if there was any issue with this.</p>