UNPKG

es-toolkit

Version:

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

13 lines (8 loc) 268 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const sum = require('./sum.js'); function mean(nums) { const length = nums ? nums.length : 0; return length === 0 ? NaN : sum.sum(nums) / length; } exports.mean = mean;