; {
const values = [1, 2, 3, 4, 5].values()
for (const value of values) {
if (value % 2) values.next()
console.log(value)
}
}
@Lady why
@aescling because i needed to skip some iterations in a for…of loop?
const pipesIterator = Object.entries(pipes).values();
for (const [pipeNº, index] of pipesIterator) {
/* … */
let nextPipeNº = pipeNº;
while (pipes[++nextPipeNº] < lastIndex) {
// skip pipes which precede lastIndex
if (pipesIterator.next().done) {
break;
} else {
continue;
}
}
}
@aescling (pipes here is an array, if that helps)
@aescling oh i guess there is an Array::entries() method which i could be using instead of Object.entries(…).values() but same thing
just legitimately had to use this technique; a·m·a