Creates a 2-dimensional array to fit a grid of rows x cols. The outer array is the rows, the inner arrays are the columns.
const arr = createArray(0, { rows: 10, cols: 20 });arr[4][9]; // Get value at row 5, col 10 Copy
const arr = createArray(0, { rows: 10, cols: 20 });arr[4][9]; // Get value at row 5, col 10
Initial value to fill array
Grid shape to make
Creates a 2-dimensional array to fit a grid of rows x cols. The outer array is the rows, the inner arrays are the columns.