From 2ee663e9404bd568b1831b8507bd2eb8c7d6db41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Wed, 3 Nov 2021 13:46:02 +0100 Subject: [PATCH] Clarify using-reduce sumOrMul descriptions --- subjects/using-reduce/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/subjects/using-reduce/README.md b/subjects/using-reduce/README.md index 6a784192..a3a640a4 100644 --- a/subjects/using-reduce/README.md +++ b/subjects/using-reduce/README.md @@ -7,7 +7,9 @@ Create three functions : - `adder` that receives an array and adds its elements. - `sumOrMul` that receives an array and adds or multiplies its elements - depending on whether the element is an odd or an even number. + depending on whether the element is an odd or an even number, where: + - even = multiply + - odd = add - `funcExec` that receives an array of functions and executes them. @@ -17,9 +19,9 @@ initial value for the functions execution. Example: ```js -sumOrMul([1, 2, 3, 4], 5) - // -> (((5 + 1) * 2) + 3) * 4 - // -> 60 +sumOrMul([1, 2, 3, 5, 8], 5) + // -> ((((5 + 1) * 2) + 3) + 5) * 8 + // -> 160 ```` #### Special instruction