February 2018
Intermediate to advanced
298 pages
8h 22m
English
A stored item inside a session storage object can be accessed using the localStorage.getItem, localStorage.key, or localStorage['key'] methods. We'll take a look at this in more detail a little later, in the localStorage.getItem('key') versus localStorage.key section, where we'll see which method is the best and why not to use other methods; now, though, let's stick with the localStorage.getItem method.
It's easy to get stored items from local storage, as shown in the following snippet:
const item = localStorage.getItem('myKey');console.log(item); // my awesome value
Read now
Unlock full access