Side effects

The side effects module contains functions to perform side effects on a grid like traversing a grid without manipulating it.

import {createGridFromArray2D} from "gridl/core";
import {forEachCell} from "gridl/sideEffects";

const grid = createGridFromArray2D([
    [1, 2, 3],
    [4, 5, 6],
]);

let str = "";
forEachCell(grid, (cellValue) => {
    str = `${str}${cellValue}`;
});
// => str === "123456"