Sobes.tech
Junior — Senior

Simulating the Array.prototype.filter method using reduce

livecode

Task condition

Write a function that reproduces the behavior of the standard Array.prototype.filter method, using the reduce method to select the desired array elements. The function should accept an array and a predicate function, returning a new array containing only those elements for which the predicate returns true.

Simulating the Array.prototype.filter method using… - sobes.tech