p5.js | append() function
The append() function in p5.js is used to add value at the end of a given array i.e, it increases the length of the original array by one.
Parameters: This function accepts two parameters as mentioned above and described below:
- Array: It is the original input array to which a new value to be added.
- Value: It is the value which to be added at the end of the Array.
Return Value: It returns the new appended array.
Below program illustrates the append() function in p5.js:
Example: This example uses append() function to add any value at the end of the input array.