Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# sessionStorage
store a value `sessionStorage["key"] = "value";`
## Store multiple values
- to store values "one", "two", "three"
store as follows : `sessionStorage['key"] = ["one", "two", "three"];`
- to retrieve multiple values stored use as follows
`var array = sessionStorage["key"].toString().split(",");`
## Integer values
Integer values are not directly accessible without any conversion. So they should be converted as follows
- var id = Number(String(sessionStorage["key"]));
## Check if key exists/ data is already availble (only case when tab is reloaded)
`if (sessionStorage["idd"]) console.log("exists");`
[sessionStorage Reference](
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.