@devlander/utils
Version:
Comprehensive JavaScript and TypeScript utilities for seamless development. Includes object manipulation, data validation, and more.
10 lines (9 loc) • 399 B
TypeScript
/**
* Calculates the average of an array of numbers.
*
* @param {number[]} nums - The array of numbers to calculate the average of.
* @returns {number} The average of the numbers in the array.
* @throws {Error} If the input is not a non-empty array of numbers.
* @throws {Error} If any element in the array is not a valid number.
*/
export declare function getAverage(arr: number[]): number;