{"name":"BIS_fnc_conditionalSelect","title":"BIS fnc conditionalSelect","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_conditionalSelect","revid":327949,"updated":"2022-07-13T12:57:27Z","groups":["Arrays"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"This returns a sub-array of elements that satisfy a specific condition **in the order they have been passed**.\n\n> [!NOTE]\n> **Arma 3:** Since Arma 3 v1.55, use `array select condition` instead.\n\nIn the condition, the currently tested element is assigned to the variable \"_x\".\nThe original array is **not** modified.","syntaxes":[{"syntax":"[items, condition] call BIS_fnc_conditionalSelect","params":[{"name":"items","type":"Array","description":"array to check","type_expr":"Array"},{"name":"condition","type":"Code","description":"selection code","type_expr":"Code"}],"returns":{"type":"Array","type_expr":"Array"}}],"examples":[{"code":["[[10, 0, 8, 2, 6, 4], { _x > 5 }] call BIS_fnc_conditionalSelect; // will return [10,8,6]"]},{"code":["[[10, true, 8, player], { typeName _x == \"STRING\" }] call BIS_fnc_conditionalSelect; // will return []"]}],"see_also":["select","count"]}