Lets say I have an array like so:
['x','cat', 'dog', 'x', 'dolphin', 'cougar', 'whale']
I don't know the length of the array or when an 'x' will occur. When I reach 'x' I want to push the following elements into a new array until I reach the next element that includes?('x').
The desired output would be:
[['cat', 'dog']['dolphin','cougar', 'whale']]
How can I achieve this?
'x'in a row or it ends on'x'? What's the behavior? Ignore or have an empty[]?