Async Thread Test

by kyrisu

JavaScript

const arr = Array(500)
  .fill()
  .map((_, i) => i);

async function testAsync() {
  // if you uncomment the line bellow end will appear before the count finishes
  // await fetch("https://jsonplaceholder.typicode.com/todos/1");
  for (const iterator of arr) {
    console.log(iterator);
  }
}

console.log(`=============== start ===============`);
testAsync();
console.log(`=============== end ===============`);