Skip to content
Junior–Senior161 views

Independent implementation of the filter function

Task condition

It is necessary to write a custom version of the filter function that takes an array and a predicate function, returning a new array containing only those elements for which the predicate returned true. When implementing, it should be considered that the original array must not be modified, and the predicate can accept one, two, or three arguments (element, index, original array).

Frontend tasks in the code trainer