title: constructing two dimensional array dynamically
body: <p>I have some values in JavaScript array as shown </p>
  
  <pre><code>var sampledata = {10,20,30,40};// these values would come from database later
  </code></pre>
  
  <p>I want to create a two dimensional array with these values.</p>
  
  <p>I want to create a array as </p>
  
  <pre><code>var newData = [[0,10],[1,20],[2,30],[3,40]]
  </code></pre>