Functional Programming Concepts
10 JavaScript functional programming concepts challenges, each with test cases you can run in the browser.
- mapSquares — Easy. Given an array of numbers, return a new array where each number is squared. Use the functional programming method 'map'.
- memoize — Medium. Create a function that memoizes the results of another function. A memoized function stores the results of expensive function calls and retu
- filterEvens — Easy. Given an array of numbers, return a new array containing only the even numbers. Use the `filter` method.
- reduceSum — Easy. Given an array of numbers, calculate their sum using the `reduce` method.
- compose — Medium. Implement a `compose` function that takes two functions, f and g, and returns a new function that is the composition of f and g (i.e., f(g(x
- pluckProperty — Easy. Given an array of objects and a property name, return a new array containing the value of that property from each object.
- findFirstEven — Easy. Given an array of numbers, find and return the first even number. If no even number is found, return undefined.
- everyIsPositive — Easy. Given an array of numbers, use the `every` method to check if all numbers in the array are positive.
- someIsNegative — Easy. Given an array of numbers, use the `some` method to check if at least one number in the array is negative.
- groupBy — Hard. Given an array of objects and a property name, group the objects by the value of that property. The output should be an object where keys ar