From b63f436a7eb0f8fd4b041a1e7958386010e8697b Mon Sep 17 00:00:00 2001 From: Katerina Pilatova Date: Thu, 16 May 2024 15:20:14 +0200 Subject: [PATCH] Add multiply function without tests --- src/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/index.ts b/src/index.ts index 6b8af74..57741b7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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; @@ -19,4 +23,14 @@ if (require.main === module) { FRIDAY_COUNT, ]), ); + + console.info( + multiply([ + MONDAY_COUNT, + TUESDAY_COUNT, + WEDNESDAY_COUNT, + THURSDAY_COUNT, + FRIDAY_COUNT, + ]), + ); }