UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

11 lines (9 loc) 438 B
/** * Finds the element in an array that has the maximum value. * * @template T - The type of elements in the array. * @param {ArrayLike<T> | null | undefined} [items] - The array of elements to search. Defaults to an empty array. * @returns {T | undefined} - The element with the maximum value, or undefined if the array is empty. */ declare function max<T>(items: ArrayLike<T> | null | undefined): T | undefined; export { max };