(window.onresize = () => { canvas.width = innerWidth, canvas.height = innerHeight; })(); // Condensed (window.onresize=e=>{canvas.width=innerWidth,canvas.height=innerHeight})()