Axios spread() with unknown number of callback parameters Axios spread() with unknown number of callback parameters ajax ajax

Axios spread() with unknown number of callback parameters


You somewhere will need to make the actual requests. And then don't use spread but only then to receive the array of results:

let urlArray = [] // unknown # of urls (1 or more)let promiseArray = urlArray.map(url => axios.get(url)); // or whateveraxios.all(promiseArray).then(function(results) {  let temp = results.map(r => r.data);  …});