So I’ve got an array that has thousands of values. The delimiter is the same and the content is all numbers. It’s a simple array.
Example..
[491353764,202825540,338196858]
Imagine that is 15000 values. I need to split the array into multiple groups of 100 strings.
I got the first 100 fine using this:
ids = ids.toString();
ids = ids.split(',', 100);
console.log(ids.toString());
I know this is basic stuff, but I couldn’t find anything that would allow me to split it multiple times into groups. Am I focusing on the wrong thing thinking some version of split will do the job? Do I need to put it through a loop?
I assume you want to store the groups of 100 in another Array…
DEMO: http://jsfiddle.net/rP2Kq/1/