VOOZH
about
URL: https://www.geeksforgeeks.org/javascript/p5-js-loop-function/
⇱ p5.js loop() Function - GeeksforGeeks
👁 geeksforgeeks
Courses
Tutorials
Interview Prep
JS Tutorial
Web Tutorial
A to Z Guide
Projects
OOP
DOM
Set
Map
Math
Number
Boolean
Exercise
p5.js loop() Function
Last Updated :
12 Jul, 2025
The
loop() function
is used to call draw() function continuously. The loop() function can be stopped using noLoop() function.
Syntax:
loop()
Below example illustrates the
loop()
function in p5.js:
Example:
Output:
👁 Image
Online editor:
https://editor.p5js.org/
Environment Setup:
https://www.geeksforgeeks.org/javascript/p5-js-soundfile-object-installation-and-methods/
Comment
Article Tags:
Article Tags:
JavaScript
Web Technologies
JavaScript-p5.js
Explore
JavaScript Basics
Introduction
3 min read
Variables
5 min read
Operators
4 min read
Control Statements
4 min read
Array & String
Arrays
6 min read
Array Methods
7 min read
String
5 min read
String Methods
8 min read
Function & Object
Functions
4 min read
Function Expression
3 min read
Function Overloading
4 min read
Objects
4 min read
Constructors
4 min read
OOP
OOP
6 min read
Classes & Objects
4 min read
Access Modifiers
5 min read
Constructor
4 min read
Asynchronous JavaScript
Asynchronous
2 min read
Callbacks
4 min read
Promises
4 min read
Event Loop
3 min read
Async Await Fuction
3 min read
Exception Handling
Error and Exceptional Handling
5 min read
Errors Throw & Try to Catch
2 min read
Custom Errors
2 min read
TypeError Invalid Array.prototype.sort argument
1 min read
DOM
DOM
8 min read
DOM Elements
3 min read
Custom Events
4 min read
Addeventlistener
5 min read
Advanced Topics
Closure
3 min read
Hoisting
5 min read
Scope
4 min read
Higher Order Functions
7 min read
Debugging
3 min read
Courses
JavaScript Programming Course
2 min read
DSA Java Coursescript
2 min read
DSA and System Design Course
2 min read