setup()
setup() runs exactly once when the sketch starts, which makes it the right place to configure the canvas. Using windowWidth and windowHeight instead of fixed numbers is a common pattern for full-screen, responsive sketches.
function setup(){createCanvas(windowWidth,windowHeight);}
Line-by-line explanation (1 lines)
createCanvas(windowWidth,windowHeight);- Creates a canvas that exactly matches the current browser window size, so the ocean scene fills the whole screen instead of a fixed small box.