Aşama 1 Soru 8
unknown
typescript
9 months ago
220 B
13
Indexable
function sum(...numbers: number[]): number {
return numbers.reduce((accumulator, currentValue) => {
return accumulator + currentValue;
}, 0);
}
console.log(sum(1, 2, 3));
console.log(sum(10, 20, 30, 40));Editor is loading...
Leave a Comment