reduceRight wrong example? #78
Open
Labels
Comments
|
They're using different demo functions, and their return values are consistent with those functions. Returning the sum is just a common example use case for
['a', 'b', 'c', 'd'].reduce((current, carry) => current+carry); // ➡ abcd
['a', 'b', 'c', 'd'].reduceRight((current, carry) => current+carry); // ➡ dcba |
|
Yeah @QWp6t you're right, I should make that a little more clear and easy to understand for beginners, since that's who this resource is for. |
|
@sdras - hello! Can I work on this issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm not sure, but in
find items -> one item:reducereturns sum of the array, as I'd expect, whilereduceRight'flatten' arrays. Shouldn't it be also sum?The text was updated successfully, but these errors were encountered: