I have an array (took from an API) with near 300 values, but I need to call someAction() with sets of 10 values. I mean, 1-10, 11-20, 21-30… and so. I was limiting it to 10, but other 290 values were lost.
Its a multidimensional array.
var n = 10; // Limit of names
for (var i = 0; i < n; i++) {
namestr += names[i].first + "(" + names[i].nick + ")";
if(i != (n-1)){namestr += ", ";}
}
someAction(namest, function(){...});
Thanks for your help
If you just want to call someAction on every 10 elements you might do this:
Based on your comment, you could do this: