I have a somewhat complicated task of slicing and dicing an array of data into a sensible JSON Object. The first step is to slice the array into smaller arrays based on the content of the elements.
In this simplified version I want to break one big array into a series of smaller arrays defined by the word "that."
Given this array:
that, thing, thing, that, thing, that, thing, thing, thing
I want to return:
[that, thing, thing],
[that, thing],
[that, thing, thing, thing],
that?