The getItem(key)
method is used to
retrieve the value associated with
a specific key from the storage.
In the above example, the getItem
method is used
to retrieve the value associated with the username key.
Let's look at how we do this in sessionStorage:
In the above example, the getItem
method is used
to retrieve the value associated with the session_active key.