0

As part of bootstraper script i am writing for a html template, i am required to use an API for determining names of various countries corresponding to there alpha-3 codes, like CHN for China and GBR for Greate Britian.

I would like to know if there is some JQuery method that will allow me to "iterate" over an array of these alpha-3 country codes and make a GET request to the remote server for the country name corresponding to each code.

Is there a such a method ? Essentially what i am looking for is the web browser equivalent of Node.js's async.forEachSeries() function.

Atif Farooq
  • 208
  • 2
  • 8
  • Does this answer your question? [Using async/await with a forEach loop](https://stackoverflow.com/questions/37576685/using-async-await-with-a-foreach-loop) – VLAZ Dec 31 '19 at 18:38
  • Multiple choices here: [How to sequence promises](https://stackoverflow.com/questions/29880715/how-to-synchronize-a-sequence-of-promises/29906506#29906506). The simplest in modern browsers is a `for` loop with `await`. The `.reduce()` loop and a number of the other solutions there work in any browser. As best I know, jQuery does not have this feature built-in. – jfriend00 Jan 01 '20 at 04:53

0 Answers0