Last active
November 27, 2019 16:10
-
-
Save spyesx/881b329ef58a8a5825b5eae3a7d5fcd0 to your computer and use it in GitHub Desktop.
5G Vote
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 cleanStorage = function(){ | |
console.log('%c Start clean localStorage', 'color: green') | |
var myStorage = window.localStorage; | |
var ids = Object.keys(myStorage).filter( (key) => { | |
return key.slice(0,3) === '5G_' | |
}) | |
ids.forEach( (id) => { | |
console.log('clean: '+id) | |
window.localStorage.removeItem(id); | |
}) | |
console.log('%c Complete clean localStorage', 'color: red') | |
setTimeout( cleanStorage, Math.floor(Math.random() * 6000) + 4000) | |
} | |
cleanStorage() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment