From a686fc294facb48de04b3e335cf2d1cd82620739 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 7 May 2025 11:23:28 -0400 Subject: [PATCH] Implement totalBatteries using reduce --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index f73934895..441a22e2c 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ const batteryBatches = [4, 5, 3, 4, 4, 6, 5]; // Code your solution here +const totalBatteries = batteryBatches.reduce((totalCount, battery) => totalCount + battery, 0)