

If you’re iterating over a whole array and need the index, like in ll.15f., you can instead write
particles.forEach((particle, i) => {
// loop body
})
There may be a performance hit (I haven’t tested it) because you’re invoking a function on each iteration. And it’s mostly a stylistic choice.






My company dabbles in AI. A hardly abridged conversation with a bot I’ve read recently:
Yep, AI definitely is the future.