JS Conjunto de tamanho de lona

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