1
Hello, I am using the library store.js to facilitate and I would like to know how I can do to check if there is a key in Storage.
thank you so much for your attention and good night :D
1
Hello, I am using the library store.js to facilitate and I would like to know how I can do to check if there is a key in Storage.
thank you so much for your attention and good night :D
2
store#get()
returns the value of the respective key, if it exists, otherwise this value will be Undefined. Then you can use it to check if there is something set to a certain key:
if(store.get('chave')){
// Existe.
}
I created an example in jsfiddle because snippets here at Stackoverflow do not allow the use of Storage:
Browser other questions tagged html5
You are not signed in. Login or sign up in order to post.
Thanks partner, killed my doubt ! D
– Restolhada