JSFiddle - React, Tailwind, and code Playground

by Rahsheen Porter

JavaScript

const loopAsync = async iter => new Promise(resolve => {
  let n = 0;
  while (n < iter * 1000000000) n++;
  resolve(n);
});

loopAsync(1).then(console.log);
console.log('Main thread');