Constructor
new mw.Map()
#
Create an object that can be read from or written to via methods that allow interaction both with single and multiple properties at once.
- Source:
Methods
exists(selection) → {boolean}static
#
Check if a given key exists in the map.
get(selection, fallback) → {any|Object|null
}static
#
null
}static
#
Get the value of one or more keys.
If called with no arguments, all values are returned.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
selection |
string | Array |
optional |
Key or array of keys to retrieve values for. |
|
fallback |
any |
optional |
null | Value for keys that don't exist. |
- Source:
Returns:
If selection was a string, returns the value, If selection was an array, returns an object of key/values. If no selection is passed, a new object with all key/values is returned.
- Type
-
any
|
Object
|
null
Get the value of one or more keys.
set(selection, value) → {boolean}static
#
Set one or more key/value pairs.