Last active
August 2, 2016 17:27
-
-
Save mindaslab/f593f02aea75844076f5ef88d429267b to your computer and use it in GitHub Desktop.
Javascript local storage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var testObject = { 'one': 1, 'two': 2, 'three': 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)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment