Answers for "localstorage documentation"

28

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
42

localstorage javascript

localStorage.setItem('user_name', 'Rohit'); //store a key/value
var retrievedUsername = localStorage.getItem('user_name'); //retrieve the key
Posted by: Guest on October-23-2019
0

localstorage

localStorage.setItem('Items' , 'Bread');
let Bread = localStorage.getItem('Items');
Posted by: Guest on April-17-2021
1

javascript localstorage

var KeyName = window.localStorage.key(index);
Posted by: Guest on May-22-2020
0

save to local storage

var cat = localStorage.getItem('myCat');
Posted by: Guest on April-27-2020
0

localstorage

localStorage.removeItem('myCat');
Posted by: Guest on August-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language