Today's problem is a two part problem. You'll be implementing a filter function and a reduce function.
Filter is a function that takes in a function and an array and runs each value of the array through the filter. The function passed in to the filter will return either a true or false value. For all values in the array that evaluate to true return that value. One example is an isOdd function with an array [1,2,3] which would return [1,3].
Reduce is a function that takes in a function and an array and runs each value of the array through the reducer. The goal is to run each item in the array through the list and then combine the output in to a single value. One example is an adder function with an array [1,2,3] which would return 6.
Comments:
Mike N. - 9 years, 6 months ago
Python:
Output:
reply permalink
Driphter - 9 years, 6 months ago
Clojure!
reply permalink