Skip to content

Commit

Permalink
Add multiply function without tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlacenka committed May 16, 2024
1 parent f5688b2 commit b63f436
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ export function sum(numbers: number[]): number {
return numbers.reduce((acc, value) => acc + value, 0);
}

export function multiply(numbers: number[]): number {
return numbers.reduce((acc, value) => acc * value, 1);
}

// eslint-disable-next-line unicorn/prefer-module
if (require.main === module) {
const MONDAY_COUNT = 1;
Expand All @@ -19,4 +23,14 @@ if (require.main === module) {
FRIDAY_COUNT,
]),
);

console.info(
multiply([
MONDAY_COUNT,
TUESDAY_COUNT,
WEDNESDAY_COUNT,
THURSDAY_COUNT,
FRIDAY_COUNT,
]),
);
}

0 comments on commit b63f436

Please sign in to comment.