Is it a misuse of reduce to modify acc (because, ideally in functional programming, things are immutable), or does returning acc from the reducer function mitigate that?
I would go for the mitigation :P
const groupCitiesByRotatedNames = cities => newArray
I guess you could return always a clone of acc? For the purpose of the article, I would not give too much importance to this to be honest :)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.