Created
November 3, 2014 09:50
-
-
Save kimat/0189b82f8901ce701430 to your computer and use it in GitHub Desktop.
This file contains 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
// create a dictionary | |
var dictionary = { "key1" : "val2" }; | |
// cast to string | |
var dictionary_string = JSON.stringify(dictionary); | |
// save in local storage | |
localStorage.setItem("my",dictionary_string); | |
// read back from local storage | |
var my_string = localStorage.getItem("my"); | |
// cast back to js dictionary | |
var dictionary = JSON.parse(my_string); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment