Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on How to use array reduce for more than just numbers. Parent comment
What leads you to this dogma?
Why is mutation of a tightly scoped local variable bad?
The initial accumulator of a reducer usually does not exist until the reducer is invoked, or is defined as an arg to the reducer.
What possible harm could result from mutating it in a tight loop until it is returned?
This is not to say that mutation is fine in all circumstances. That's crazy. There are tradeoffs.
But to declare an entire technique off limits, what are your reasons? You seem to assume your own conclusion.
There are no comments on this comment yet.
What leads you to this dogma?
Why is mutation of a tightly scoped local variable bad?
The initial accumulator of a reducer usually does not exist until the reducer is invoked, or is defined as an arg to the reducer.
What possible harm could result from mutating it in a tight loop until it is returned?
This is not to say that mutation is fine in all circumstances. That's crazy. There are tradeoffs.
But to declare an entire technique off limits, what are your reasons? You seem to assume your own conclusion.