Function toArray

Returns a two-dimensional array according to grid size.

const a = Grids.toArray({ rows: 3, cols: 2 });
Yields:
[ [_,_] ]
[ [_,_] ]
[ [_,_] ]

initialValue can be provided to set the value for all cells.

  • Type Parameters

    • V

    Parameters

    • grid: Grid

      Grid

    • OptionalinitialValue: V

      Initial value

    Returns V[][]