{"name":"BIS_fnc_getFromPairs","title":"BIS fnc getFromPairs","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_getFromPairs","revid":349332,"updated":"2023-11-08T14:53:28Z","groups":["Arrays"],"status":"ok","games":{"arma3":"1.02"},"since":"arma3 1.02","arma3_since":"1.02","description":"Searches the associative array for the 1st occurance of the key string and returns the value associated with it. Search is not case sensitiv.","syntaxes":[{"syntax":"[array, key, defaultValue] call BIS_fnc_getFromPairs","params":[{"name":"array","type":"Array","description":"array to search through","type_expr":"Array"},{"name":"key","type":"String","description":"key to search for","type_expr":"String"},{"name":"defaultValue","type":"Anything","optional":true,"default":"nil","description":"default return value if no match was found","type_expr":"Anything","text":"defaultValue: Anything - (Optional, default nil) default return value if no match was found"}],"returns":{"type":"Anything","type_expr":"Anything","description":"value associated with the key."}}],"examples":[{"code":["[[[\"apple\",3],[\"pear\",\"test\"]],\"pear\"] call BIS_fnc_getFromPairs; // Returns \"test\""]},{"code":["[[[\"apple\",3],[\"pear\",6]],\"pear\"] call BIS_fnc_getFromPairs; // Returns \"6\""]}],"see_also":["find","findIf","BIS_fnc_findInPairs","BIS_fnc_addToPairs","BIS_fnc_removeFromPairs","BIS_fnc_setToPairs"],"notes":[{"user":"Benargee","date":"2014-10-02T01:17:00Z","text":"BIS_fnc_findInPairs renamed to BIS_fnc_getFromPairs and now supports all variable types [Source](http://dev.arma3.com/post/spotrep-00011)"}]}