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