February 2018
Intermediate to advanced
298 pages
8h 22m
English
A stored item inside the sessionStorage object can be accessed using the sessionStorage.getItem, sessionStorage.key, or sessionStorage['key'] methods. However, as with localStorage, it is advisable to make use of getItem to safely get the right storage value instead of a property of the sessionStorage object.
The following snippet demonstrates how to get a stored item from session storage:
const item = sessionStorage.getItem('myKey');console.log(item); // my awesome value
Read now
Unlock full access