UNPKG

@modern-kit/utils

Version:
13 lines (10 loc) 264 B
import { sum } from '../sum/index.mjs'; function average(arr, iteratee) { if (arr.length < 1) return 0; if (!iteratee) { return sum(arr) / arr.length; } return sum(arr, iteratee) / arr.length; } export { average }; //# sourceMappingURL=index.mjs.map