getOrDefault

From Bohemia Interactive Community
Jump to navigation Jump to search
Introduced with Arma 3 Development Branch version 2.012.01DEV BRANCH ONLY ⚠
Hover & click on the images for descriptions

Description

Description:
Retrieves a value out of a HashMap after looking it up by its key. When the HashMap doesn't contain the key, the default value is returned

Syntax

Syntax:
hashMap getOrDefault [key, defaultValue]
Parameters:
hashMap : HashMap
key: HashMapKey
defaultValue: Anything - (Optional, default nil)
Return Value:
Anything

Examples

Example 1:
private _myValue = _myHashMap getOrDefault ["a", "Not Found!"];

Additional Information

See also:
HashMap get
Groups:
HashMap

Notes

i
Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.