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 - 10 years, 3 months ago
reply permalink
Phil - 10 years, 3 months ago
Javascript:
var ar = [ [ [7,5,3],[52,2] ], [ [45,467] ] ];
var result = [].concat.apply(ar);
reply permalink