How to get an index in for-of-loop | index in for-of-loop
The for…of statement creates a loop iterating over iterable objects, including: built-in String, Array, array-like objects (e.g., arguments or NodeList), TypedArray, Map, Set, and user-defined iterables. for (variable of iterable)…