From 5156aa6611ecc0b811f58dda86f7bc2606608dc1 Mon Sep 17 00:00:00 2001 From: Rhys <105ron@users.noreply.github.com> Date: Fri, 28 Sep 2018 13:35:40 +0800 Subject: [PATCH] Update calculator.js --- calculator/calculator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator/calculator.js b/calculator/calculator.js index 56b6288..6037434 100644 --- a/calculator/calculator.js +++ b/calculator/calculator.js @@ -10,7 +10,7 @@ function sum(array) { return array.reduce((current, total) => total + current, 0); } -function multiply (array) { +function multiply(array) { return array.length ? array.reduce((accumulator, nextItem) => accumulator * nextItem): 0; }