[Solved] merge n arrays in one multidimensional in javascript [closed]
This is what I came up with: First calculate the longest array. Then loop over the arrays, and loop over the items. Here’s a fiddle var a = [ ‘a1’, ‘a2’ ], b = [ ‘b1’, ‘b2’ ], c = [ ‘c1’, ‘c2’, ‘c3’ ]; var to2DArray = function(){ var maxLength = 0, arrays = … Read more