How to Get an Index in a for…of Loop in JavaScript and Node.js
JavaScript introduced the for…of loops with ECMAScript 2015. The for loop provides a convenient way of iterating over a collection of items. A downside of a for…of loop: by default, it doesn’t give you the item’s index. Yet, you can conveniently work around this shortcoming and …
Continue Reading