DieselDepot-APP/node_modules/es-toolkit/dist/compat/math/sum.d.mts
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

20 lines
No EOL
533 B
TypeScript

//#region src/compat/math/sum.d.ts
/**
* Computes the sum of the values that are returned by the `iteratee` function.
*
* It does not coerce values to `number`.
*
* @param array - The array to iterate over.
* @returns Returns the sum.
*
* @example
* sum([1, 2, 3]); // => 6
* sum([1n, 2n, 3n]); // => 6n
* sum(["1", "2"]); // => "12"
* sum([1, undefined, 2]); // => 3
* sum(null); // => 0
* sum(undefined); // => 0
*/
declare function sum(array: ArrayLike<any> | null | undefined): number;
//#endregion
export { sum };