From ac6567a2de9c2ba2bf5e744189db8b733a685b23 Mon Sep 17 00:00:00 2001 From: Mahesh-rathod13 Date: Mon, 12 May 2025 16:56:05 +0530 Subject: [PATCH] feat : add function of sum of the array --- ArraySum.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 ArraySum.js diff --git a/ArraySum.js b/ArraySum.js new file mode 100644 index 0000000..43ae9fb --- /dev/null +++ b/ArraySum.js @@ -0,0 +1,9 @@ +const ArraySum = (numbers) =>{ + return numbers.reduce((accumulator, currentValue)=>{ + return accumulator + currentValue; + }, 0); +} + +export { + ArraySum +} \ No newline at end of file