Published on September 13th, 2019
Okay, you heard about that cool thingy called local storage where you can save client side data, but you don’t know how to really use it. Great, you’ll learn it here but first lets talk limitations.
Enough about limitations. Let’s dive into local storage! To set item you need to call
setItem method and specify key and value as JSON.
localStorage.setItem('key', 'some json value')
To get item you, obviously, need to call
getItem and specify only key…
…and same thing for removing item
Last thing I’ll show you is how to wipe out whole local storage.
And there is nothing more to it than this. You are now local storage ninja!