That is to make this:
[ [\'dog\',\'cat\', [\'chicken\', \'bear\'] ],[\'mouse\',\'horse\'] ]
into:
[\'dog\',\'cat\',\'chicken\',\'
I know this is late but I also ran into a situation where I needed to make a multidimensional array into 1 array and I made a function as follows.
function nested(arr) {
var noNest = arr.toString().split(',').filter(Boolean),
i = 0;
for(i;i
This also take the nested arrays inside the tested array and makes sure its one array as the final out put