This is just an example of how to use an offscreen <canvas> element as an offscreen drawing buffer for drawing a background, so you don’t have to redraw it every animation frame, as explained by GRUNT on StackOverflow, Mozilla's <canvas> performance guide (which also suggests using multiple overlaid <canvas> tags to avoid redrawing backgrounds), or Boris Smus’s 02011 <canvas> performance guide, rather than using Mozilla's experimental OffscreenCanvas API which allows you to do this in a Web Worker. In this case the background is super boring.