|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
440 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Calculates the average of an array of numbers.
|
|---|
| 3 | *
|
|---|
| 4 | * If the array is empty, this function returns `NaN`.
|
|---|
| 5 | *
|
|---|
| 6 | * @param {number[]} nums - An array of numbers to calculate the average.
|
|---|
| 7 | * @returns {number} The average of all the numbers in the array.
|
|---|
| 8 | *
|
|---|
| 9 | * @example
|
|---|
| 10 | * const numbers = [1, 2, 3, 4, 5];
|
|---|
| 11 | * const result = mean(numbers);
|
|---|
| 12 | * // result will be 3
|
|---|
| 13 | */
|
|---|
| 14 | declare function mean(nums: readonly number[]): number;
|
|---|
| 15 |
|
|---|
| 16 | export { mean };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.