Creates a new Hash
_array | Array of key-value pairs to create Hash from [Array, defaults to []] |
_defaultValue | Default value. Used when key doesn’t exist. A key is also removed from the hash if the value is set to this default [Any, defaults to nil] |
Newly created Hash [Hash]
_emptyHash = [] call CBA_fnc_hashCreate; [_emptyHash, "frog"] call CBA_fnc_hashGet; // => nil _pairs = [["frog", 12], ["fish", 9]]; _animalCounts = [_pairs, 0] call CBA_fnc_hashCreate; [_animalCounts, "frog"] call CBA_fnc_hashGet; // => 12 [_animalCounts, "monkey"] call CBA_fnc_hashGet; // => 0 [_animalCounts, "monkey", 25] call CBA_fnc_hashGet; // => 25
Spooner