⁘ collections

Dictionary

go to → Members

new Dictionary()

TODO

Members

read-onlycount :number

TODO

read-onlyinternalMap :map

TODO

read-onlyisEmpty :boolean

TODO

read-onlykeys :IterableIterator.<any>

TODO

Methods

Clear()

Clears the Dictionary from all keys and values.

Contains(p_key) → {boolean}

Return whether or not the Dictionary contains the given key.

Parameters:
Name Type Description
p_key *

ForEach(p_fn, p_this, p_reverse)

Loops through all keys in Dictionary. Callback should match the signature : (key, value).

Parameters:
Name Type Default Description
p_fn function
p_this object null
p_reverse boolean false

Get(p_key) → {*}

Return the value associated with the given key.

Parameters:
Name Type Description
p_key *

GetValueKeys(p_value) → {array}

Reverse lookup through the keys and return an array of keys mapped to given value. Costly function, avoid.

Parameters:
Name Type Description
p_value *

Remove(p_key) → {boolean}

Remove the given key from the Dictionary, along with its associated value. Returns true if the key existed and has been removed, otherwise return false.

Parameters:
Name Type Description
p_key *

Set(p_key, p_value)

Associate a value to a given key.

Parameters:
Name Type Description
p_key *
p_value *