UNPKG

@1771technologies/lytenyte-pro

Version:

Blazingly fast headless React data grid with 100s of features.

12 lines (11 loc) 539 B
/** * Finds the maximum value in an array of numbers that may include null or undefined values. * Iterates through the array from right to left. * @param data - An array of numbers that may include null or undefined values * @returns The maximum number found in the array. Returns 0 for empty arrays or if no valid numbers are found. * @example * max([1, null, 3, undefined, 2]) // Returns 3 * max([]) // Returns 0 * max([null, undefined]) // Returns 0 */ export declare function max(data: (number | null | undefined)[]): number;