Should one use for-of or forEach when iterating through an array? [duplicate]
I recommend to always use for … of in ES6. It works on any iterable It supports all kinds of control flow in the loop body, like continue, break, return, yield and await. Also I personally find it more readable, but that comes down to preference. Some people think forEach is a more functional style, … Read more