So I have been trying to create an empty 2d array and trying to push values into it. The following code is as follows.
// Create an array like [[],[]]
let series = new Array(2).fill([]);
//try to push value into the array in position 0 like [[5],[]]
series[0].push(5); // output here is [[5],[5]]
How can I push element to the array at index 0?
There is something I'm missing. Any help is appreciated!!