Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

await reserved word testcafe using await in loop

async function foo(things) {
  const results = [];
  for (const thing of things) {
    // Good: all asynchronous operations are immediately started.
    results.push(bar(thing));
  }
  // Now that all the asynchronous operations are running, here we wait until they all complete.
  return baz(await Promise.all(results));
}
Source by eslint.org #
 
PREVIOUS NEXT
Tagged: #await #reserved #word #testcafe #await #loop
ADD COMMENT
Topic
Name
7+5 =