Last active
December 19, 2015 12:39
-
-
Save nefarioustim/5955934 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 (LocalStorage) { | |
var DELIM = "|"; | |
LocalStorage.readit = function (key) { | |
console.log('FN .get for key', key); | |
var str = localStorage.getItem(key); | |
console.log('get raw=', str); // e.g. 't35' | |
if (str === null || str === ''){ | |
return null | |
} | |
console.log('delim', DELIM); // outputs | | |
var rv = str.split(DELIM); // split is not in-place | |
console.log('splitted', rv); // rv = [''] not 't35'?! | |
return rv; | |
} | |
})(window.LocalStorage = window.LocalStorage || {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment