Function can be in-built, already made for use in the editor like background(220)
Function can also be custom-built, made according to the need like
function move(){ }
Code:
In the code below the in-built background() is moved from function draw
(which runs repeatedly and clears up the canvas) to the function setup .
As the function setup, runs once that is why one can see the trail of squares forming.