I'm a big fan of reduce but there's often a simpler solution, or at least one which makes for more legible code. For example you can flatten an array of arrays using concat and restructuring e.g.
const a = [[1,2,3,4,5],[1,2,3,4,5]];
const flattened = [].concat(...a);
// flattened will be ... [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
As a general policy I try to name my reducer function arguments to reflect what they're doing in the specific case rather than just giving them general names (as you do in your examples i.e. map vs acc for the 'previousValue' argument).
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.
I'm a big fan of reduce but there's often a simpler solution, or at least one which makes for more legible code. For example you can flatten an array of arrays using concat and restructuring e.g.
As a general policy I try to name my reducer function arguments to reflect what they're doing in the specific case rather than just giving them general names (as you do in your examples i.e.
map
vsacc
for the 'previousValue' argument).