# Javascript Async Function **Published by:** [Higgs](https://paragraph.com/@higgss/) **Published on:** 2022-08-06 **URL:** https://paragraph.com/@higgss/javascript-async-function ## Content 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 } ## Publication Information - [Higgs](https://paragraph.com/@higgss/): Publication homepage - [All Posts](https://paragraph.com/@higgss/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@higgss): Subscribe to updates - [Twitter](https://twitter.com/higgs_Fair): Follow on Twitter