Answers for "local storage how much can store javascript"

36

Javascript store 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 object
Posted by: Guest on July-22-2019
0

This function is used to store items in local storage

window.localStorage.setItem("grade","One");
//in this case, the `grade` is the key while `One` is the value.
Posted by: Guest on September-05-2021

Code answers related to "local storage how much can store javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language