Posted By

djmicahelb on 04/11/10


Tagged


Versions (?)

Convert MultiDimensional Array into a single dimension Array


 / Published in: JavaScript
 

Use this to convert a Multidimensional Array (an array of arrays) into one long array. Great to use before running the unique script for instance

  1. for (i=0; i<multiArray.length; i++) {
  2. for (x=0; x<multiArray[i].length; x++) {
  3. singleArray.push(multiArray[i][x]);
  4. };
  5. };

Report this snippet  

You need to login to post a comment.