Answers for "How to make use of Local Storage Object"

28

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

How to Use Local Storage with JavaScript?

const Car = {
  brand:"Suzuki",
  color:"white",
  price:10000
}

window.localStorage.setItem('car', JSON.stringify(Car));
Posted by: Guest on September-05-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language