Functions
map
- map<T, K>(fn: function): function
- map<T, K>(fn: MapFn<T, K>, items: T[]): K[]
- map<T, K>(items: T[], fn: MapFn<T, K> | keyof T): K[]
-
Type parameters
Parameters
Returns function
-
Type parameters
Parameters
Returns K[]
-
Type parameters
Parameters
-
items: T[]
-
fn: MapFn<T, K> | keyof T
Returns K[]
Takes a function and a functor, applies the function to each of the functor's values, and returns a functor of the same shape.
const isOdd = (n) => n % 2 === 1; R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4] R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}