When I create localstorage
await localStorage.setItem(item_id, JSON.stringify(products));
I Have garbage values debugbar-time
, debugbar-time-new
I handle these garbage values like this condition's
if (x != 'debugbar-time-new' && x != 'debugbar-time' && x != '__mycart' && x!= 'favorite_tables')
But some time these values are change like _mycart
, favorite_tables
and I didn't use these words in my project. How can I handle these garbage values?
question from:
https://stackoverflow.com/questions/65881990/when-i-create-localstorage-in-javascript-garbage-values-auto-created 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…