UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

8 lines (5 loc) 159 B
import { sumBy } from './sumBy.mjs'; function meanBy(items, getValue) { return sumBy(items, item => getValue(item)) / items.length; } export { meanBy };