Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70909

How to check if duplicate key exists in local -storage in ionic

$
0
0

@vithika wrote:

I have stored data in local storage,with key and values,

key is account name..
When a user creates a new account ,i want to put a check if the same key exists or not ..

how should i achieve this,if the same key exists,then alert should be created else not..

I tried using the get item function ,but everytime it returns null,wheteer or not the key exists..

 if(localstorage.getItem(this.account.value.name)===null)
{
alert
}
else..
{
}

this does not works for me...

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70909

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>