Last active
March 8, 2017 06:57
-
-
Save channprj/8f7a8fb786b929c817539b4674865899 to your computer and use it in GitHub Desktop.
Count all of sessionStorage values.
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
var cnt = 0; | |
for(var i=0; i < sessionStorage.length; i++){ | |
if (JSON.parse(sessionStorage.getItem(sessionStorage.key(i))).length > 0) { | |
cnt = cnt + JSON.parse(sessionStorage.getItem(sessionStorage.key(i))).length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment