You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/rules/no-array-for-each.md
+1
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ Benefits of [`for…of` statement](https://developer.mozilla.org/en-US/docs/Web/
12
12
- Faster
13
13
- Better readability
14
14
- Ability to exit early with `break` or `return`
15
+
- Ability to skip iterations with `continue`
15
16
16
17
Additionally, using `for…of` has great benefits if you are using TypeScript, because it does not cause a function boundary to be crossed. This means that type-narrowing earlier on in the current scope will work properly while inside of the loop (without having to re-type-narrow). Furthermore, any mutated variables inside of the loop will picked up on for the purposes of determining if a variable is being used.
0 commit comments