title: Convert a nested array to plain Arrays
body: <p>I have an array like below  </p>
  
  <pre><code>var arr = [["a", "b"],[1],[5,6]];
  </code></pre>
  
  <p>I would like to convert it to plain JSON like below  </p>
  
  <pre><code>arr = [
       ["a","a","b","b"]
       [1,1,1,1]
       [5,6,5,6]
  ]
  </code></pre>
  
  <p>The logic is  </p>
  
  <p>Under each item of first array element all the elements are sub elements, under next each array items of [1], [5,6] are sub elements</p>
  
  <p><code>a-&gt;1-&gt;[5,6]</code><br>
  <code>b-&gt;1-&gt;[5,6]</code>  </p>
  
  <p>if <code>var arr = [["a", "b"],[1,2],[5,6]];</code> then</p>
  
  <p><code>a-&gt;[1]-&gt;[5,6]</code><br>
  <code>a-&gt;[2]-&gt;[5,6]</code></p>
  
  <p>like the same with element b also. I am struck, as I don't know how to proceed</p>