createHashMapFromArray: Difference between revisions
Jump to navigation
Jump to search
(added alt syntax) |
(added alt syntax) |
||
Line 17: | Line 17: | ||
|r1= [[HashMap]] | |r1= [[HashMap]] | ||
| | |s2= keys [[createHashMapFromArray]] values {{Since|arma3|2.04|y}} | ||
| | |p21= keys: [[Array]] - Array of [[HashMapKey]]s | ||
| | |p22= values: [[Array]] - Array of [[Anything|anything]] | ||
{{Feature|Informative|Size of ''keys'' and size of ''values'' arrays do not need to be equal. Missing values will be filled with [[ | {{Feature|Informative|Size of ''keys'' and size of ''values'' arrays do not need to be equal. Missing values will be filled with [[nil]].}} | ||
|r2= [[HashMap]] | |r2= [[HashMap]] |
Revision as of 14:28, 16 April 2021
Description
Syntax
- Syntax:
- createHashMapFromArray [[key1, value1], [key2, value2]]
- Parameters:
- key: HashMapKey
- value: Anything
- Return Value:
- HashMap
Alternative Syntax
- Syntax:
- keys createHashMapFromArray values Template:Since
- Parameters:
- keys: Array - Array of HashMapKeys
- values: Array - Array of anything
- Return Value:
- 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"]]
Additional Information
- See also:
- createHashMap
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note