Workshop › Snake › Step 1 of 28
Steer a growing snake to the food without hitting the walls or yourself. Grids, arrays, the game loop and keyboard input.
Games are drawn on a <canvas>: a rectangle of pixels on the page. The page already has one with the id game.
First we get hold of it from JavaScript.
```js
const canvas = document.getElementById('game')
```document is the page. getElementById('game') finds the element whose id is game.const canvas = gives what was found a name, so later lines can use it.Write the line under the three comment lines, then press Run.
Skills: Drawing on a canvas