Answers for "foreach await js"

4

foreach async typescript

for (const file of files) {
    const contents = await fs.readFile(file, 'utf8');
    console.log(contents);
  }
Posted by: Guest on February-11-2020
2

async foreach

[1, 2, 3].forEach(async (num) => {  await waitFor(50);  console.log(num);});console.log('Done');
Posted by: Guest on September-15-2020
0

foreach await js

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

  for (const file of files) {
    const contents = await fs.readFile(file, 'utf8');
    console.log(contents);
  }
}
Posted by: Guest on September-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language