Answers for "loop array with await"

0

loop foreach async await

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
0

loop through async javascript -1

someArray.forEach(function(item, i) {
    asynchronousProcess(function(item) {
        console.log(i);
    });
});
Posted by: Guest on September-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language