DEV Community

Discussion on: reduce or for…of?

the3rdc profile image
Cody Crumrine

Thanks for the post! Great breakdown.

I'm gonna chime in here to be that guy that says "do the thing that makes the most sense semantically".

If what you're doing is best expressed as "working through each item" use "for...of". If it's best expressed as "condensing a series of items down to a single item" use reduce.