# Javascript Async Function

By [Higgs](https://paragraph.com/@higgss) · 2022-08-06

---

const main=async (n,m)=>{ await xls(); const promises = \[\]; for (let i = n; i <= m; ++i) { pkey=worksheet.getCell(`L${i+1}`).value; promises.push(); } Promise.all(promises) .then(() => { console.log("\[n->m\] All done"); }) .catch((e) => { // Handle errors here }); //await }

---

*Originally published on [Higgs](https://paragraph.com/@higgss/javascript-async-function)*
