Last active
May 13, 2018 00:11
-
-
Save luislobo14rap/693f4f2291f8e60ba15ca217a128ea3e 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
function getLocalJSON(objName) { | |
if (typeof objName == 'string') { | |
if (localStorage.getItem('objJSON-' + objName) !== null) { | |
let objValue = localStorage.getItem('objJSON-' + objName); | |
return JSON.parse(objValue); | |
} else { | |
return {}; | |
}; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment