Today's problem will be a bit easier than yesterday's problem. Our goal for today is to see how deep we can go. Given an n-dimensional, integer array, combine all arrays in to one single array.
[
[
[7,5,3],[52,2]
],
[
[45,467]
]
]
[7,5,3,52,2,45,467]
Comments:
samebchase - 11 years, 1 month ago
reply permalink
Phil - 11 years, 1 month ago
Javascript:
var ar = [ [ [7,5,3],[52,2] ], [ [45,467] ] ];
var result = [].concat.apply(ar);
reply permalink