title: convert a string into a two-dimensional array in javascript
body: <p>I'm trying to convert a string like this <code>"10|15|1,hi,0,-1,bye,2"</code> where the first two elements <code>10|15</code> mean something different than <code>1,hi,0,-1,bye,2</code>. I would like to separate them from each other. A naive way to accomplish that would be: </p>
  
  <pre><code>value = string.split("|");
  var first = value[0];
  var second = value[1];
  var tobearray = value[2];
  array = tobearray.split(",");
  </code></pre>
  
  <p>(Of course, if you know a way to do this in a better way, I'd be glad to know).
  However, <code>array</code> is an array which contains <code>array[0]=1, array[1]=hi, array[2]=0, array[3]=-1</code>, etc. However, I want to obtain a two dimensional array such as </p>
  
  <pre><code>array[0][0]=1, array[0][1]=hi, array[0][2]=0
  array[1][0]=-1, array[1][1]=bye, array[1][2]=2
  </code></pre>
  
  <p>Is there any way to do that?</p>
  
  <p>Thanks</p>