Storage
interface of the Web Storage API provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.Window.sessionStorage
is made; whereas for local storage the call is made to Window.localStorage
.Returns an integer representing the number of data items stored in the Storage
object.
Promise<number>
When invoked, will empty all keys out of the storage.
Promise<undefined>
When passed a key name, will return that key's value.
string
. A string
containing the name of the key you want to retrieve the value of.Promise<string>
When passed a number n
, this method will return the name of the nth key in the storage.
number
. An integer representing the number of the key you want to get the name of. This is a zero-based index.Promise<string>
When passed a key name, will remove that key from the storage.
string
. A string
containing the name of the key you want to remove.Promise<undefined>
When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.
string
. A string
containing the name of the key you want to create/update.string
. A string
containing the value you want to give the key you are creating/updating.Promise<undefined>