Workshop › Battleship › Step 8 of 35
Before we can shoot we need one question answered: which ship of a fleet covers square (r, c), if any?
```js
const shipAt = (fleet, r, c) => fleet.find((s) => s.cells.some(([sr, sc]) => sr === r && sc === c))
```find returns the first ship for which the test is true, or undefined.some of the ship's squares has the same row and column.Write the line above function drawSea(, followed by an empty line.
Skills: Arrays and objects
← Two fleets Fire at a square →