getItem
Object|null
getItem
(
key
,
json
)
Returns the item with the specified key, or
null
if the item
was not found.
- Parameters:
-
key <String>
-
json <bool>
(optional)true
if the item is a JSON string and should be parsed before being returned
- Returns:
Object|null
- item or
null
if not found
length
Number
length
(
)
Returns the number of items in the data store.
- Returns:
Number
- number of items in the data store
removeItem
void
removeItem
(
key
)
Removes the item with the specified key.
- Parameters:
-
key <String>
- Returns:
void
setItem
void
setItem
(
key
,
value
,
json
)
Stores an item under the specified key. If the key already exists in the
data store, it will be replaced.
- Parameters:
-
key <String>
-
value <Object>
-
json <bool>
(optional)true
if the item should be serialized to a JSON string before being stored
- Returns:
void