The saveJSON() function is used to write an object or array of objects as a JSON object to the
.json file. The saving of the file will vary depending on the web browser.
saveJSON( json, filename, optimize )
Parameters: This function accept three parameters as mentioned above and described below:
- json: It is an object or array of objects that will form the contents of the JSON object to be created.
- filename: It specifies the string that is used as the filename of the saved file.
- optimize: It is a boolean value which specifies if the JSON object would be removed of line breaks and spaces before it is written. It is an optional parameter.
The examples below illustrate the saveJSON() function in p5.js:
Online editor: https://editor.p5js.org/
- How to get the function name inside a function in PHP ?
- CSS | rgb() Function
- PHP | max( ) Function
- PHP | ord() Function
- p5.js | box() Function
- p5.js | int() function
- PHP | end() Function
- PHP | min( ) Function
- p5.js | tan() function
- PHP | abs() Function
- p5.js | sin() function
- p5.js | log() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.