Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

local storage javascript object

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 object
 
PREVIOUS NEXT
Tagged: #local #storage #javascript #object
ADD COMMENT
Topic
Name
2+5 =