Description
Creates a new HashMap and initializes it from a key-value pair array
Syntax
Syntax 1
createHashMapFromArray [[key1, value1], [key2, value2], ...]
Parameters:
keyN: HashMapKeyvalueN: Anything
Returns: HashMap
Syntax 2
since arma3 2.04
keys createHashMapFromArray values
Parameters:
-
keys: Array of HashMapKeys -
Note
Size of keys and size of values arrays do not need to be equal. Missing values will be filled with nil.
Returns: HashMap
Examples
Example 1
createHashMapFromArray [["a", 1], ["b", 2], ["c", 3]];
Example 2
[1, 2, 3, 4] createHashMapFromArray []; // returns [[1, <null>], [2, <null>], [4, <null>], [3, <null>]]
Example 3
[1, 2, 3] createHashMapFromArray ["one", "two", "three", "four"]; // returns [[1, "one"], [2, "two"], [3, "three"]]