how to draw a rectangle in your canvas using javascript html code code example
Example 1: js draw square to canvas
// canvas context.fillRect(x, y, height, width);
ctx.fillRect(20, 20, 150, 100);
Example 2: javascript rect
// canvas context.fillRect(x, y, width, height);
ctx.fillRect(20, 20, 150, 100);