mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-08-29 04:32:06 -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];
|
||
|
|
}
|