Clear An HTML Canvas With JavaScript
I'm using `.clearRect() [TODO: Code shorthand span ] to clear the contents of an HTML canvas element like this example which draws a square and then immediately clears it.
Notes
-
The values of [TODO: Code shorthand span ] are:
start x, start y, end x, end y
-
Using the [TODO: Code shorthand span ] and [TODO: Code shorthand span ] of the canvas automatically takes you do the end.
-
Which, when combined with setting the start x and start y to zero, clears the entire thing
~ fin ~