Getting started
Classes
Typedefs
Dictionary
Kind: global class
Summary: the Dictionary stores key:value pairs of data. The keys are strings, the data can be anything.
A Dictionary is fast for create/read/update/remove actions,
as well is searching for entries that can be uniquely identified by their key
- Dictionary
- .getValues() ⇒
Array
- .getKeys() ⇒
Array
- .get(key) ⇒
*
- .set(key, value) ⇒
Dictionary
- .remove(key) ⇒
Dictionary
- .hasKey(key) ⇒
boolean
- .hasValue(value) ⇒
boolean
- .forEach(cb) ⇒
Dictionary
- .clear() ⇒
Dictionary
- .isEmpty() ⇒
boolean
- .getValues() ⇒
Array
Dictionary.getValues() ⇒ Kind: static method of Dictionary
Summary: returns an array of the values contained in the Dictionary
Array
Dictionary.getKeys() ⇒ Kind: static method of Dictionary
Summary: return an array of all existing keys in the dictionary
*
Dictionary.get(key) ⇒ Kind: static method of Dictionary
Summary: returns the stored value, identified by its key, otherwise undefined
Param | Type |
---|---|
key | key |
Dictionary
Dictionary.set(key, value) ⇒ Kind: static method of Dictionary
Param | Type | Description |
---|---|---|
key | key |
|
value | * |
value to bind to the key |
Dictionary
Dictionary.remove(key) ⇒ Kind: static method of Dictionary
Summary: deletes the key:value pair from the Dictionary's data, if present.
Param | Type |
---|---|
key | key |
boolean
Dictionary.hasKey(key) ⇒ Kind: static method of Dictionary
Summary: tests if the given key exists in the Dictionary
Param | Type |
---|---|
key | key |
boolean
Dictionary.hasValue(value) ⇒ Kind: static method of Dictionary
Summary: searches the entire dictionary until the value is found (strict equality)
Param | Type | Description |
---|---|---|
value | * |
value to find |
Dictionary
Dictionary.forEach(cb) ⇒ Kind: static method of Dictionary
Summary: passes each pair in the dictionary through the provided callback function.
The callback is called with four arguments (key, value, index, array),
where array is the array-representation of the Dictionary's data
Param | Type | Description |
---|---|---|
cb | function |
callback |
Dictionary
Dictionary.clear() ⇒ Kind: static method of Dictionary
Summary: removes all pairs in the dictionary. This is a fairly slow operation, use with caution.
boolean
Dictionary.isEmpty() ⇒ Kind: static method of Dictionary
Summary: tests if the dictionary contains any keys
key
Kind: global typedef
Summary: used to uniquely identify an entry. All keys are coerced into strings.