CBA_fnc_hashCreate

Description

Check if a Hash has a value defined for a key.

Parameters

_arrayArray of key-value pairs to create Hash from [Array, defaults to []]
_defaultValueHash to look for key in [Any, defaults to nil]

Returns

Newly created Hash [Hash]

Examples

_emptyHash = [] call hashCreate;
[_emptyHash, "frog"] call CBA_fnc_hashGet; // => nil

_pairs = [["frog", 12], ["fish", 9]];
_animalCounts = [_pairs, 0] call hashCreate;
[_animalCounts, "frog"] call CBA_fnc_hashGet; // => 12
[_animalCounts, "monkey"] call CBA_fnc_hashGet; // => 0

Author

Spooner

Close