source:
node_modules/es-toolkit/dist/compat/math/mean.mjs@
ba17441
| Last change on this file since ba17441 was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 171 bytes | |
| Line | |
|---|---|
| 1 | import { sum } from './sum.mjs'; |
| 2 | |
| 3 | function mean(nums) { |
| 4 | const length = nums ? nums.length : 0; |
| 5 | return length === 0 ? NaN : sum(nums) / length; |
| 6 | } |
| 7 | |
| 8 | export { mean }; |
Note:
See TracBrowser
for help on using the repository browser.
