How do I push a 1-dimensional array into a 2-dimensional array?
When I use either:
phData.push(ehRow);
phData.push([ehRow]);
all I get is the last ehRow replicated 1000 times after exiting the for loop. If I hard code the 26 elements of ehRow as arguments to the push, I get what I want, but surely there's a better way.
As a guess:
var array = ['a','b','c']
var array_2d = array.map(x => [x])
console.log(array_2d); // --> [['a'],['b'],['c']]
var another_2d_array = [['d'], ['e'], ['f']]
var final_2d_array = [...another_2d_array, ...array_2d]
console.log(final_2d_array); // --> [['d'],['e'],['f'],['a'],['b'],['c']]