mirror of
https://github.com/Drop-OSS/drop
synced 2026-08-27 14:23:05 -04:00
7 lines
197 B
TypeScript
7 lines
197 B
TypeScript
|
|
export const sum = (array: number[]) =>
|
||
|
|
array.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
|
||
|
|
|
||
|
|
export function lastItem<T>(array: T[]) {
|
||
|
|
return array[array.length - 1];
|
||
|
|
}
|