Merge pull request #724 from iamashruu/patch-2

Add example of entries() method with for...of loop in JavaScript
This commit is contained in:
Fechin authored and GitHub committed 2025-09-16 16:20:34 +08:00
commit 41935754da
1 file changed
+7
+7
View File
@@ -761,6 +761,13 @@ for (let fruit of fruits) {
// => apple
// => orange
// => banana
for (let [index, value] of fruits.entries()) {
console.log(index, value);
}
// => 0 apple
// => 1 orange
// => 2 banana
```
## JavaScript Iterators {.cols-2}