Files

5 lines
156 B
TypeScript
Raw Permalink Normal View History

2026-05-26 23:36:42 -07:00
export function sum (...n) {
if (!n.every((num) => typeof num === 'number')) throw new Error('Not a number')
return n.reduce((acc, cur) => acc + cur)
}