Because we can now use modern JavaScript with UXP it would be nice to use for…of to loop over Collections (ItemCollection, LayerCollection, etc), but it’s not possible because the collections start at index 1. Trying to convert the Collection Proxy to an array with Array.from won’t work for the same reason.
I’m aware this is a low-priority nice-to-have, but I would love to see it.
for (const layer of comp.layers) {
// do something with `layer`
}
instead of
for (let i = 1; i <= comp.layers; i++) {
const layer = comp.layers[i]
// do something with `layer`
}
The latter has always confused beginners/developers new to AE.