LendAndRegret/node_modules/es-toolkit/dist/math/meanBy.mjs
2026-05-02 17:27:43 +08:00

8 lines
159 B
JavaScript

import { sumBy } from './sumBy.mjs';
function meanBy(items, getValue) {
return sumBy(items, item => getValue(item)) / items.length;
}
export { meanBy };