title: javascript - How to split JSON array into separate arrays for DataTables
body: <p>I am trying to take a JSON array like this</p>
  <pre><code>[Alex, James, John]
  </code></pre>
  <p>and create seperate JSON arrays for them like this</p>
  <pre><code>[[Alex], [James], [John]]
  </code></pre>
  <p>So I can then insert the JSON payload into a datatable using Datatables.JS</p>
  <p>So far I have this</p>
  <pre><code>var data = json;
  while (data.length) {
    console.log(data.splice(0, 1));
  }
  return data;
  </code></pre>
  <p>Now this splits the JSON into 3 seperate arrays but when I try to use the data variable in the datatables.JS, it complains that is not in the proper format because it is</p>
  <pre><code>[Alex] 
  [James] 
  [John]
  </code></pre>
  <p>in the console.</p>
  <p>I want to combine them into the JSON payload described above so I can insert it into the datatable.</p>