Sep 5, 2018 · 1 min read
Hi Rahul,
Thanks for writing here and you are completely correct.
This could be achieved with a Promise function instead of callback function as I have done here. I haven’t written a promise function in this particular case but if you had one, then you would push these into an array as you have done with yourpromiseArr and call the Promise.all method with this array. Well done!
Actually Promises are preferable to callbacks in my opinion. Perhaps I will edit the article to use a Promise function instead.
