Generate a height × width 2D grid; every cell holds defaultValue. Restricted to primitives at the type level — for object/array cells use the factory overload to avoid every cell sharing the same reference.
Generate a height × width 2D grid by invoking factory(x, y) for each cell. Use this overload for object/array cells (and for any per-cell computation).
Generate a
height × width2D grid; every cell holdsdefaultValue. Restricted to primitives at the type level — for object/array cells use the factory overload to avoid every cell sharing the same reference.