Workshop › Connect Four › Step 21 of 38
To find four in a row we will walk from cell to cell. We must never step off the board, so first a small helper:
inside(row, col) is true only for a cell that exists.
```js
const inside = (row, col) => row >= 0 && row < ROWS && col >= 0 && col < COLS
```{ } after =>, the value on the right is returned.&& needs all four checks to be true: the row from 0 to 5 and the column from 0 to 6.Above function play( write inside, followed by an empty line.
Skills: Functions
← Watch it fall Walking along a line →