Final answer:
To clear a drawing space for each callback of the draw() method, you call the clear() function.
Step-by-step explanation:
To clear a drawing space for each callback of the draw() method in p5.js, you can call the clear() function. This function clears the entire canvas, allowing you to start fresh with each frame. Here's an example:
function setup() {
createCanvas(400, 400);
}
function draw() {
clear();
// draw your new frame here
}