If the given array contains an element matching the predicate it is removed, otherwise it is added to the end.
For your convenience the given element value is also passed to the predicate as a second parameter,
so you can easily compare the two if needed.
If the given array contains an element matching the predicate it is removed, otherwise it is added to the end. For your convenience the given element value is also passed to the predicate as a second parameter, so you can easily compare the two if needed.