Skip to content

counting

Counts the occurrences of each unique value returned by the `identity` function when applied to each item in the array.

Usage

counting([1, 2, 3, 4], (n) => (n % 2 === 0 ? "even" : "odd")); // { even: 2, odd: 2 }

Installation

Terminal window
npx atmx add helper counting