var testObject = { 'name': 1, 'email': 2, 'password': 3 };
// Put the object into storage
localStorage.setItem('testObject', JSON.stringify(testObject));
// Retrieve the object from storage
var retrievedObject = localStorage.getItem('testObject');
console.log('retrievedObject: ', JSON.parse(retrievedObject));
I want to display only email or name how to do
2
Answers
You can do it like this
and then you access name and email like the following: