Enumerate rows of grid, returning all the cells in the row as an array
for (const row of Grid.As.rows(shape)) { // row is an array of Cells. // [ {x:0, y:0}, {x:1, y:0} ... ]} Copy
for (const row of Grid.As.rows(shape)) { // row is an array of Cells. // [ {x:0, y:0}, {x:1, y:0} ... ]}
Use Grid.values to convert the returned iterator into values:
Grid.values
for (const v of Grid.values(Grid.rows(shape))) {} Copy
for (const v of Grid.values(Grid.rows(shape))) {}
Optional
Enumerate rows of grid, returning all the cells in the row as an array
Use
Grid.values
to convert the returned iterator into values: