Closed darkamenosa closed 6 years ago
Thanks for finding and fixing this bug.
However, rather than fixing this with slice()
, I'd rather fix it by saying [...fns].reverse().reduce(..)
(still all on one line, for layout reasons). And btw, this code is repeated/quoted in chapter 9, so it needs to be fixed there, too. :)
Also, in chapter 9, about a page after that reference, fns.reverse().reduce(..)
is quoted again, in a paragraph, so that should be updated, as well.
I have changed the implementation follow your recommendation and updated chapter 9. Thanks for reminding me.
Hi, I guess if we are using spread to splice the array, so we could use the reduceRight
to avoid reverse
and slice
at all, am I wrong? :)
@getify, thanks a lot for the Book.
@DScheglov this is intentionally not done here because we come back to the topic of compose(..)
in ch9 when we talk about list operations, and we illustrate reduceRight(..)
there.
Thanks so much!
This commit fixes #146