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));
我只想显示电子邮件或姓名怎么办
2条答案
按热度按时间fdx2calv1#
你可以这样做
sdnqo3pr2#
然后您访问名称和电子邮件,如下所示: