javascript store object in localstorage
var person = { "name": "billy", "age": 23};
localStorage.setItem('person', JSON.stringify(person)); //stringify object and store
var retrievedPerson = JSON.parse(localStorage.getItem('person')); //retrieve the objectlocalStorage.setItem('myCat', 'Tom');var cat = localStorage.getItem('myCat');
Also in JavaScript:
- how to set text for label in jquery
- javascript conditional ? :
- How can I upload files asynchronously
- angular calendar updating until hovering
- how to replace array element in javascript without mutation
- jquery .not or
- javascript automatic click
- router flux pass props stack react native
- react mui icons
- copy a file and paste with fs
- javascript clear div
- how to use a script to inject a meta attribute in html
- how to convert json to javascript object
- how to use react memo hooks
- convert object to json javascript
- node pg array in
- Iterate with JavaScript Do...While Loops
- Orderby on multiple columns using typeorm
- jspdf cdn
- hidden jquery
- array every javascript
- json introduction
- react post request
- chartjs start at 0