SHIFT + D

associative array set

Updated on August 22, 2024Source codeTests

createAssociativeArraySet is a link that sets a key/value pair on an associative array.

Create set

Call createAssociativeArraySet with these parameters to create your set function:

Parameter
Type
Required
Description
key
any
yes
The key to set (add or overwrite).
value
any
yes
The value to set on the associative array.
options
Object
no
Options to customize the behavior of the set function. See the Options section for more guidance.

Options

Option
Type
Default
Description
predicateKey
Function
Strict equality check

A function that accepts a key and returns a boolean indicating whether or not the key matches the one you're looking for.

When you're setting a new key, predicateKey is expected to return false on all existing keys.

associative array deleteclear

Edit doc on GitHub

ON THIS PAGE

associative array setCreate setOptions