You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I consider that the equals symbol in the expression result += x is redundant (and maybe even misleading). The first argument to the reduce function is a function that must return the new accumulator... So that expression (when you include the arrow function behavior) is the same as doing result = result + x; return result, making the assignment (not the addition) kinda useless.
P.D: the parenthesis surroinding the x in the map function are optional, but options are ok ;)
The text was updated successfully, but these errors were encountered:
Citing the actual solution in 0.7.0
I consider that the equals symbol in the expression
result += x
is redundant (and maybe even misleading). The first argument to the reduce function is a function that must return the new accumulator... So that expression (when you include the arrow function behavior) is the same as doingresult = result + x; return result
, making the assignment (not the addition) kinda useless.P.D: the parenthesis surroinding the
x
in the map function are optional, but options are ok ;)The text was updated successfully, but these errors were encountered: