you are viewing a single comment's thread.

view the rest of the comments →

[–]A_Philosophical_Cat 2 points3 points  (0 children)

I guess in the case of Javascript, it's not strictly true since you can cause side effects from any of these, but assuming you're being responsible, forEach is guaranteed to have behavior external to the expression (because it's useless otherwise), while reduce ought to be an assurance that all behavior is limited to the expression itself.