Home

Karaoke with Async/Await

--- START --------------------------------------------


const n=document.getElementById("lyrics"),e="<p><span>1</span> I, I will be king</p>",a="<p><span>2</span> And you, you will be queen</p>",i="<p><span>3</span> Though nothing will drive them away</p>",p="<p><span>4</span> We can beat them, just for one day</p>",t="<p><span>5</span> We can be heroes, just for one day</p>",s=(n=2e3)=>new Promise(e=>setTimeout(e,n));!async function(){n.innerHTML+="<p>--- START --------------------------------------------</p>",await s(),n.innerHTML+=e,await s(),n.innerHTML+=a,await s(),n.innerHTML+=i,await s(),n.innerHTML+=p,await s(),n.innerHTML+=t,await s(),n.innerHTML+="<p>--- END ----------------------------------------------</p>",console.log("lyrics written to page")}();
//# sourceMappingURL=karaoke.js.map