Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

foreach async not working

async function printFiles () {
  const files = await getFilePaths();

  for (const file of files) {
    const contents = await fs.readFile(file, 'utf8');
    console.log(contents);
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #foreach #async #working
ADD COMMENT
Topic
Name
3+7 =