Skip to content
W. ❝Mac❞ McMeans edited this page Jan 2, 2024 · 7 revisions

localDataStorage.poke( arrayKeyName, value [, index] )

This is used to place a value onto an existing arrayKeyName, an Array Key, optionally at the index position, as a destructive insert which replaces the original element. When index is omitted, the element is appended to the Array Key by default. When specified, the index is automatically corrected to prevent sparse arrays.

EXAMPLES:

🔹 Existing Array Key called 'course' having value [{'book':'math'}, {'book':'english'}, {'book':'science'}]:

Replace the English book:
● localData.poke( 'course', {'book':'french'}, 2 ); --> [{'book':'math'}, {'book':'french'}, {'book':'science'}]

Append a new book to the array:
● localData.poke( 'course', {'book':'biology'} ); --> [{'book':'math'}, {'book':'french'}, {'book':'science'}, {'book':'biology'}]

The value of the updated arrayKeyName is returned when this method executes.

📝 NOTE: This method is specific to Array Keys and will fail if used on any other key type. This method is related to push and pull. Array Keys use one-based array indices.

localStorage Keys

The usual suspects:

set / get      clear      key      remove

The esoteric ones:

Array Keys:
push / pull, pullall      poke      contains      where

Broadcasting:
broadcast

Bypass:
forceset / forceget

Data Transfer:
import / export

Duplicates:
countdupes, showdupes, listdupes

Internals:
cancrunch      crunch / uncrunch

shufflestring / unshufflestring

xorstring

Management:
keys

Memory Consumption:

Memory Quota:
showquota

Query:
haskey, hasval, hastype

Security:
safeset / safeget

setscramblekey / getscramblekey

Type Check:
isarray      isbigint      isboolean      iscrunch

isdate      isfloat      isinteger      isnull

isnumber      isobject      isstring

showtype

Utility:
chopget      copy      softset      rename

Properties:

channel      length      quota      version

Settings:

verbosity

Memory Keys

Standard:

_set / _get      _clear      _key      _remove

Unconventional:

Data Sync:
_backup / _restore

Management:
_keys

Security:
_safeset / _safeget

Type Check:
_isarray      _isbigint      _isboolean      _iscrunch

_isdate      _isfloat      _isinteger      _isnull

_isnumber      _isobject      _isstring

_showtype

Utility:
_chopget      _copy      _softset      _rename

Clone this wiki locally