Last active
September 8, 2015 04:40
-
-
Save kavitshah8/badfae13772f3d5ecf64 to your computer and use it in GitHub Desktop.
getters and setters for 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
// setter | |
localStorage.setItem("employeeName", "Ryan"); | |
localStorage.setItem("employeeId", 121456789); | |
// getter | |
var name = localStorage.getItem("employeeName"); // Ryan | |
var id = localStorage.getItem("employeeId"); // 121456789 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment