It uses reduce to feel functional and hip, but in practice it just mutates the arrays and passing them as is (they are mutated, but it's the same reference) to the next iteration.
But even proper uses of fold/reduce are usually clearer and simpler when done with loops, because the whole point of reduce was to emulate foreach in purely functional languages.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
+1 about
reduce
. Consider #3 in dev.to/thejohnstew/5-programming-p...It uses
reduce
to feel functional and hip, but in practice it just mutates the arrays and passing them as is (they are mutated, but it's the same reference) to the next iteration.But even proper uses of
fold
/reduce
are usually clearer and simpler when done with loops, because the whole point ofreduce
was to emulateforeach
in purely functional languages.