This page does not use general-page.js
Testing the local storage scripts in localstorage.js
- (uses localStorage.length)
storage key(s):
- whatIsInLocalStorageKey ← localStorage.key(k)
input name:
input value:
- into localStorage.setItem(name, value)
- show found value foundValue ← localStorage.getItem
- show showLocalStorageInId('foundValue') ← localStorage.getItem(0..n)
found value
?
- eraseStorageOfName ← localStorage.removeItem()
Results
resultsString
Reminder of the Storage Interface
Storage.key()
- When passed a number n, returns the name of the nth key in the storage. The order of keys is user-agent defined, so you should not rely on it.
Storage.getItem()
- When passed a key name, will return that key's value.
Storage.setItem()
- When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.
Storage.removeItem()
- When passed a key name, will remove that key from the storage.
Storage.clear()
- When invoked, will empty all keys out of the storage.