We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f012ee0 commit f149c51Copy full SHA for f149c51
1 file changed
docs/rules/array-foreach.md
@@ -92,6 +92,13 @@ for (const el of els) {
92
}
93
```
94
95
+Use [`entries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) to get access to the index:
96
+```js
97
+for (const [i, el] of els.entries()) {
98
+ els.name = `Element ${i}`
99
+}
100
+```
101
+
102
## Version
103
104
4.3.2
0 commit comments