Well, I have an array of numbers and I need to send each one separately to the server, but I need to wait for all to be executed before executing my final action. I researched and then discovered the method / function WHEN
that expects all requests to be closed to execute X function.
The problem is that I do not know how to rotate the entire contents of the array and insert it in that WHEN .. I have no idea ..
See a demonstrative example of it:
$.when(ajax1(), ajax2(), ajax3(), ajax4()).done(function(a1, a2, a3, a4){
But my array data does not only have a1, a2, a3 e a4
they can have many more up to "infinites" or just 1 or two items.
My array in case: [1,2,3,4,5,6,6,77,44,23423,234212344]
Ah, I use forEach
to run the array