Workshop › Pool › Step 4 of 33
Each ball in balls is drawn as a filled circle of radius R at its position, in its color.
```js
for (const b of balls) {
ctx.fillStyle = b.color
ctx.beginPath()
ctx.arc(b.x, b.y, R, 0, Math.PI * 2)
ctx.fill()
}
```beginPath starts a new shape.arc(x, y, r, start, end) adds a circle arc around (x, y); from angle 0 to Math.PI * 2 (a full turn) is a whole circle.fill paints the shape in fillStyle.In draw, under the felt's fillRect, leave an empty line and write the loop. Press Run.
Skills: Drawing on a canvas