title: How to dynamically split an array?
body: <p>I have an array of strings, sort of like this:</p>
  
  <pre><code>["x", "foo", "y", "bar", "baz", "z", "0"]
  </code></pre>
  
  <p>And I need to split the array for every X, Y, and Z or other special keywords there are.</p>
  
  <p>I've tried to split arrays with <code>[x,y,z].split(y)</code>, but I'm pretty sure <code>split()</code> is only for strings.</p>
  
  <p>The keywords (<strong><em>x</em></strong>, <strong><em>y</em></strong>, and <strong><em>z</em></strong>) have to be the first ones in the array.
  How can I do this?</p>
  
  <p>This is what I'm trying to get:</p>
  
  <pre><code>[
      ["x", "foo"],
      ["y", "bar", "baz"],
      ["z", "0"]
  ]
  </code></pre>