The print() function in p5.js writes the content on console area of the web browser. It is helpful for looking at the data a program is producing which helps in debugging the code. The elements can be separated by using quotes (“”) and joined with the addition operator (+). Use print(‘\n’) to display blank line.
Parameters: The function accepts single parameter c which stores the any combination of Number, String, Object, Boolean, Array to print.
Below program illustrates the print() function in p5.js:
Example 1: This example uses print() function to display the content on console.
Example 2: This example uses print() function to display the content on console.
- PHP | echo and print
- Print PHP Call Stack
- How to add innerHTML to print page?
- What is the difference between echo, print, and print_r in PHP?
- PHP | Print the last value of an array without affecting the pointer
- PHP str_pad to print string patterns
- How to print an array in table format using angularJS?
- Node.js REPL (READ, EVAL, PRINT, LOOP)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.