(window.onresize = () => {
canvas.width = innerWidth, canvas.height = innerHeight;
})();
// Condensed
(window.onresize=e=>{canvas.width=innerWidth,canvas.height=innerHeight})()
function resize() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
render();
}
window.addEventListener('resize', resize, false); resize();
function render() { // draw to screen here
}