Random words with Async/Await
const e=document.getElementById("number"),n=document.querySelector("dl");async function t(){return(await fetch("https://random-words-api.vercel.app/word")).json()}e.addEventListener("change",()=>{console.clear(),n.innerHTML="";const o=[];for(let n=1;n<=e.value;n++)o.push(t());!async function(e){(await Promise.all(e)).forEach((e,t)=>{console.log("response "+t,e),n.innerHTML+=`<dt>${e[0].word}</dt><dd>${e[0].definition}</dd>`})}(o)}),e.dispatchEvent(new Event("change"));
//# sourceMappingURL=random_words.js.map