How to wait for AsyncRequests for each element from an array using reduce and promises
问题 I'm new on AngularJS and JavaScript. I am getting remote information for each of the elements of an array (cars) and creating a new array (interested prospects). So I need to sync the requests. I need the responses of each request to be added in the new array in the same order of the cars. I did it first in with a for: for (a in cars) { //async request .then(function () { //update the new array }); } This make all the requests but naturally didn't update the new array. After seeking in forums