Google News
logo
p5.js - Interview Questions
What is the draw() Function in p5.js?
The draw() function is automatically called after the setup() function, which runs once at the program’s start. The draw() loop infinitely runs the code block inside the function from top to bottom.
 
function setup(){
  // Runs once at the start of the program
}
function draw(){
  // Loops infinitely after setup() is run
}
Advertisement