Description
Removes an item from pair array, modifying or not the original array.
Syntax
[array, key, copyArray] call BIS_fnc_removeFromPairs
Parameters:
array: Array - array to search throughkey: String - key to search forcopyArray: Boolean - (Optional, default false) true to copy the array and return it, false to modify the original array
Returns: Array - resulting modified array or a copy
Examples
Example 1
private _pairs = [[["apple", 3], ["pear", 2]], "pear"];
[_pairs, "pear", true] call BIS_fnc_removeFromPairs; // returns [["apple", 3]] - _pairs is not modified
[_pairs, "pear"] call BIS_fnc_removeFromPairs; // returns [["apple", 3]] - _pairs is now [["apple", 3]]
See also
find · findIf · BIS_fnc_findInPairs · BIS_fnc_getFromPairs · BIS_fnc_addToPairs · BIS_fnc_setToPairs