JSFiddle - React, Tailwind, and code Playground

by Glutamat

JavaScript

function s () {
 return new Promise((res) => {
    setTimeout(() => res("Hi"), 2000);
 })
}

(async () => {
    let i = 4;
    while (i--) {
        const test = await s();
        console.log ("Test", test)
    }
    console.log ("After")
})()