localStorage.keys
From SmartBots Developers Docs
Bot PlaygroundBuilt-in Functions
Revision as of 21:43, 14 July 2018 by Gg (Talk | contribs) (Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Returns the list of the available keys in a persistent storage.</onlyinclude> Also check Bot_Playground/Built-in_Functions/loca...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Returns the list of the available keys in a persistent storage. Also check localStorage.set().
localStorage.keys();
Reference
This command accepts the following parameters:
Variable | Required | Description
| |
---|---|---|---|
Input: | |||
Output: | |||
value | The array of strings, key names |
Comments
Use this if you need to know the keys in your localStorage.
Example
console.log("the localStorage keeps keys ", localStorage.keys());
exit();
Or with forEach:
localStorage.keys().forEach(function(key) {
console.log(key, "=", localStorage.get(key));
});
exit();
- localStorage.keys