How do I make a html canvas width attribute the value of a js variable?

How do I make a html canvas width attribute the value of a js variable?
0.0 0

#1

like

        VARIABLEHERE1 = window.screen.availHeight;
        VARIABLEHERE2 = window.screen.availWidth;

canvas id=“myCanvas” width=“VARIABLEHERE1” height=“VARIABLEHERE2”


#2

in Vanilla JS:

document.getElementById(“myCanvas”).width = VARIABLEHERE1;
document.getElementById(“myCanvas”).height = VARIABLEHERE2;