Workshop › Sokoban › Step 5 of 29
We will keep walls and goals in a Set, which compares simple values like text but not {x, y} objects. So each tile
gets a text name: key(3, 2) is '3,2'.
```js
const key = (x, y) => x + ',' + y // one string per tile, so tiles can go in a Set
```(x, y) => ... is a short function (an arrow function) with two parameters; it gives back what is after the arrow.x + ',' + y glues the numbers and a comma into one text: key(3, 2) is '3,2'.Under the list's closing ], leave an empty line and write the key line. Press Run.
Skills: Functions
← A function that draws Read the walls →