The storeItem() function is used to store a given value under a key name in the local storage of the browser. The local storage persists between browsing sessions and can store values even after reloading the page.
It can be used to save non-sensitive information, such as user preferences. Sensitive data like personal information should not be stored as this storage is easily accessible.
Parameters: This function accepts two parameters as mentioned above and described below:
- key: This is a string which denotes the key under which the value would be stored.
- value: This is any value that can be stored under the key. It can be a String, Number, Boolean, Object, p5.Color or a p5.Vector.
Below example illustrates the storeItem() function in p5.js:
Online editor: https://editor.p5js.org/
Environment Setup: https://www.geeksforgeeks.org/p5-js-soundfile-object-installation-and-methods/
- How to get the function name inside a function in PHP ?
- PHP | Ds\Map xor() Function
- PHP | exp() Function
- D3.js | d3.hsl() Function
- PHP | sin( ) Function
- D3.js | d3.sum() function
- PHP | Ds\Map put() Function
- PHP | cos( ) Function
- PHP | pi( ) Function
- D3.js | d3.set.has() Function
- PHP | next() Function
- D3.js | d3.map.set() Function
- D3.js | d3.max() 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 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.