getOrDefault: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Push it to the limit)
 
m (Text replacement - "{{Command " to "{{RV|type=command ")
Line 1: Line 1:
{{Command
{{RV|type=command


|game1= arma3dev
|game1= arma3dev

Revision as of 02:07, 23 January 2021

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 2.01|2.01]]
Hover & click on the images for description

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
Groups:
HashMap

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

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

[[Category:Introduced with arma3dev version 2.01]][[ Category: arma3dev: New Scripting Commands | GETORDEFAULT]][[ Category: arma3dev: Scripting Commands | GETORDEFAULT]]