; { const values = [1, 2, 3, 4, 5].values() for (const value of values) { if (value % 2) values.next() console.log(value) }}
just legitimately had to use this technique; a·m·a
@Lady why
@aescling because i needed to skip some iterations in a for…of loop?
@aescling
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
A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.
@aescling oh i guess there is an Array::entries() method which i could be using instead of Object.entries(…).values() but same thing