{"name":"BIS_fnc_setToPairs","title":"BIS fnc setToPairs","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_setToPairs","revid":349084,"updated":"2023-11-08T14:47:24Z","groups":["Arrays"],"status":"ok","games":{"arma3":"1.00"},"since":"arma3 1.00","arma3_since":"1.00","description":"Works similar to the BIS_fnc_addToPairs but it doesn't try to add values. It just overwrites the volue if the key already exists.","syntaxes":[{"syntax":"[array, key, newValue] call BIS_fnc_setToPairs","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":"newValue","type":"Anything","optional":true,"default":"1","description":"new value set if match was found","type_expr":"Anything","text":"newValue: Anything - (Optional, default 1) new value set if match was found"}],"returns":{"type":"Array","type_expr":"Array","description":"resulting modified array"}}],"examples":[{"code":["[[[\"apple\",3],[\"pear\",2]],\"pear\",10] call BIS_fnc_setToPairs; // Returns [[\"apple\",3],[\"pear\",10]]"]}],"see_also":["find","findIf","BIS_fnc_findInPairs","BIS_fnc_getFromPairs","BIS_fnc_addToPairs","BIS_fnc_removeFromPairs"]}