I'm testing Eslint using the Airbn style guides, I use the airbnb-base
package
My doubt arises from this error in a loop for..of
error: no-restricted-syntax - iterator/generator
In the documentation says:
Do not use iterators. Prefer JavaScript's higher-order functions instead of loops like for-in or for-of.
and this is why:
Why? This enforces our immutable rule. Dealing with pure functions that return values is easier to reason about than side effects.
Could you explain me with an example, how do you find the mutation that you mention using another type of iterator?