Select best element from an array
| _array | Input Array [Array] |
| _criteria | Code that is passed element and should return an integer value [Code] |
| _return | default return value if array is empty (optional, default nil) [Any] |
Element that scores the highest [Any]
_result = [[2, -6, 4], {abs _x}] call CBA_fnc_selectBest;
// _result => -6
_result = [[q1, q2], {-(t1 distance _x)}, objNull] call CBA_fnc_selectBest; // selects closest target (negative distance)
// _result => q1PabstMirror