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.

  • 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
  • `async.forEachSeries` is not a nodejs function. Maybe you mean the async.js package? You can use that in a browser as well. – Bergi Jul 06 '22 at 21:00

0 Answers0