JS mengatur ukuran kanvas

canvas.width = 300;
// or, if you only have the context
ctx.canvas.width = 300;
just-saved-you-a-stackoverflow-visit