• Loading . . .

WARNING

Are you sure you want to reset the challenge? You'll lose all changes you've made to the code.

Canvas

Next, let's build a canvas. It will consist of a grid of squares, each of which can be painted with a color.

If we want a 30 x 30 canvas, we'll need 900 squares. Instead of copy-and-pasting 900 times, let's use what we know about JavaScript to programmatically create our canvas.