UNPKG

es-toolkit

Version:

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

9 lines (6 loc) 171 B
import { sum } from './sum.mjs'; function mean(nums) { const length = nums ? nums.length : 0; return length === 0 ? NaN : sum(nums) / length; } export { mean };