Skip to content

select

Select performs a filter and a mapper inside of a reduce, only iterating the list one time. If condition is omitted, will select all mapped values that are non-nullish.

Usage

select(
[1, 2, 3, 4],
(x) => x * x,
(x) => x > 2,
); // => [9, 16]

Installation

Terminal window
npx atmx add helper select