-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reduceRight wrong example? #78
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? 🙂 |
Hello,
I'm not sure, but in
find items -> one item
:reduce
returns 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: