How do I get the current iteration count of my for...of
loop?
let iterable = new Set([1, 1, 2, 2, 3, 3]);
let i = 0;
for (let value of iterable) {
console.log('value in Iteration count = ' + i + ' is :' + value);
i++;
}
This is what I currently have, is there some kind of built in iteration count variable which can replace my variable i
?